japanese's Special char encoding .Net 1.0

580 Views Asked by At

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?

3

There are 3 best solutions below

1
On

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.

1
On

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?

0
On

Try setting character set to utf-8:

  <head>
       <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
       <title>Page Title</title>
  </head>