Reputation: 979
I have asp.net
mvc3 application which displays both English and Japanese characters in label and buttons. The English/Japanese characters are fetched from resource (.resx
) file. I have hosted the site in local IIS. When I browse site from ISS, the Japanese characters are displayed correctly even if I use domain name or IP address.
Problem:
The same code I hosted in server machine IIS. When I use IP address and site name (For example, http://10.111.11.11/sitename
) the Japanese characters are displayed correctly. All is fine.
But if I use domain name (For example, http://abcd.mydomain.com/sitename
) the Japanese characters are displayed incorrectly.
What could be the problem? I have done some searches in net, but could not find any answer.
I am fetching Japanese words from resources.ja-JP.resx
file. and in my web.config
file added <globalization culture='ja-JP uiCulture='ja-JP'>
and set thread culture and uiculture in code also. And tried this too in web.config
<globalization culture='auto' uiCulture='auto'>
but none of that is working.
If i use IP address, everything working fine, but if I use specific name it is not working? Do i need change or add anything in code or IIS7?
Upvotes: 0
Views: 1199
Reputation: 26084
In your web.config
you say you have this set:
<globalization culture='ja-JP uiCulture='ja-JP'>
Seems like you are missing a quote around the culture='ja-JP
so it should be this:
<globalization
culture="ja-JP"
uiCulture="ja-JP"
/>
But do you also have the utf-8
settings in place like this?
<globalization
fileEncoding="utf-8"
requestEncoding="utf-8"
responseEncoding="utf-8"
culture="ja-JP"
uiCulture="ja-JP"
/>
Details from this official Microsoft site.
Upvotes: 1