Japanese / Chinese data in SQL Server table

So, I have an interesting problem: I need help faster than I can get my skills from SQL Server to level.

We have a table containing a bunch of text, all in different languages. Most of this data is displayed correctly in the browser, however, everything in Chinese or Japanese is completely distorted by the browser.

This is an ASP.old application that we use to display data coming from a server running MS SQL Server 2005.

Previously, we had the same problem, and we solved it by changing the encoding on the ASP pages. These files have not changed since we did, but the problem reappeared. Thus, I must conclude that the problem is with the database, as this is the only thing that has been updated since the last fix.

So far I have been trying to learn sorting, but I don’t know an SQL expert, so it was difficult.

I can provide additional information, if necessary, anything that will help someone help me answer, except for the URL (privacy and all).

If anyone has any ideas, I would really appreciate it.

ADDITIONAL INFORMATION:

-column type is 'ntext'

+3
7

, . , (. this). UCS-2, ( ). UCS-2, , ASP ​​ UTF-8 ( , UTF-8 - . /).

: , , Unicode, , , .

Unicode UTF-8 , - ( Unicode ):

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

, , .

- (, ASCII, UNICODE,...).

- , . ASCII . Unicode, , , (UTF-8, UTF-16, UCS-2,...).

. , , . Unicode (, BIG 5), -, UTF-8.

, , , (, BIG-5) , Unicode. , .

Windows, . , .

+4

, , , , . , . , , , .

nvarchar ntext ? , . , - , .., , nvarchar ntext.

, , ASP . ASP classic, - .

+4

ASP?

<%@codepage=65001%>
Session.CodePage = 65001
+1

, Management Studio. , .

, , , .

  • ? ( ASP) , ?

  • ? / "" .

, . . / (, ASP), .

0

, . , ntext, varchar. , -.

?

0

, .

(Shift_JIS, EUC-JP JIS- , ) Unicode (UTF-8 UTF-16), UTF-8; Windows UTF-16 ( NTEXT NVARCHAR MS SQL Server).

, , . , Unicode , , Shift-JIS, big5, gb2312 - .

-, , ​​ 65001, <% @codepage = 65001% > ASP.

, (-), UTF-8. , HTTP-; - HTTP- .

:

HTTP-, ASP ( javascript, , , vbscript, , ) Response.ContentType = "/html"; Response.Charset = "UTF-8";

MSSQL , -, , . , " ".

SQL- , SQL. ( ), N'MyText, "MyText" . , adVarChar, adVarWChar. ( "W" ADO).

, HTML LANG . , , LANG = "ja-jp" HTML ( BODY). ( , ). , 5 , , , , .

, shift-jis , , , , windows-1252 <% @codepage = 1252% > , . , Shift-Jis-in-1252 iso-8859-1, 100% .

SQL-, . NVARCHAR NTEXT ( , -). varchar , .

0

Source: https://habr.com/ru/post/1703575/


All Articles