BeetleDev.com
info
contact
Tuesday, September 07, 2010
Beetle Blog
Tips on using Japanese with ASP.net
By: douglas - ASP.net - 7/30/2003 6:28:00 PM

Add shift jis to meta tag
<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">

Add globalization to the web.config

 <system.web>
<globalization
fileEncoding="shift_jis"
requestEncoding="shift_jis"
responseEncoding="shift_jis"
/>
</system.web>

If using DreamweaverMX, go to "Page Properties" and choose shift jis as the encoding for the page.

In VS.net 2005 go to "File" - "Advanced Save Options...".  Then choose "Unicode (UTF-8 with signature) - Codepage 65001".  It seems that if you choose shift-jis as the save settings (or Western European), when you open the page again the Japanese characters will be messed up.  But if you save as Unicode you can open the file with the Japanese characters intact.  This seems to work for ascx files too.

Update:
Found out that if you use these settings and do not use any meta tags Japanese characters seem to work ok on the page, forms and in the database.  Also be sure that the ASP.net page directive does not specify an responseEncoding.

<system.web>
    <globalization
            fileEncoding="utf-8"
            requestEncoding="utf-8"
            responseEncoding="utf-8"
   />  
</system.web>

You can change responseEncoding to shift_jis if your pages will only be using Japanese.

ใƒ†ใ‚นใƒˆ


Last Modified: 6/21/2005 11:05:19 PM

Beetle Blog v0.2.2


Copyright © 1997 - 2010 BeetleDev.com. All rights reserved.