0

I have a problem with ASP.NET and japanese. My ASP.Net Web, SQLserver DB is encoded as JAPAN SHIFT_JIS, but in japanese has about 45 special characters, enter link description here

they are not the SHIFT-JIS,

* When inserted to DB "邰" is changed to "邰"
  • In my C# code:

    string strHtmlDecode = Server.HtmlDecode("邰");
    this.txtName.Text = strHtmlDecode;
    

In the server side <.cs code file> when debuging return true character

"邰"

But the respond to client (HTML page) is not true. Because of page's encoding is shift-jis

=> solution for solve this problem?

=> Or how can I encode only "txtName" TextBox as utf-8 in a Shift-jis page?

user1299527
  • 121
  • 1
  • 1
  • 5

3 Answers3

0

Try setting character set to utf-8:

  <head>
       <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
       <title>Page Title</title>
  </head>
kazinix
  • 28,987
  • 33
  • 107
  • 157
0

I not sure if your problem is the same as I had initially when I am doing inserting of Chinese characters. But you may try it by putting a N in front. Example

"insert into table_name(Text) values (N'" + textOfJapWord + " ')";

The column type for the "Text" is nvarchar. Probably might work?

  • "Respect". Thank for your answered. But i have tried insert that character by hand with true value and when view in my SHIFT-JIS page the character still not true. I think that SHIFT-JIS is japanese encoding but that character is cannot save as shift-jis – user1299527 Mar 30 '12 at 07:34
0

Have you tried to use newer .NET releases? .NET 4 or even .NET 2 should have better support on Japanese, so if this is a bug of .NET 1, it should already be fixed.

.NET 1.0 was end of support in 2009,

http://support.microsoft.com/lifecycle/search/Default.aspx?sort=PN&alpha=.NET+Framework

So you should never use it any more.

Lex Li
  • 60,503
  • 9
  • 116
  • 147
  • Thank for your reply, But my System is large and my customer still using it now. so that is difficult to upgrade it 2.0 or 4.0 – user1299527 Apr 05 '12 at 01:50