Answered by:
Displaying Chinese characters in UI - CSF

Question
-
I am having an issue displaying Chinese (Big5 encoded) characters in the UI (Web Browser). Background of the issue: In our application we have three layers - 1. Mainframe system (Host) 2. VC++ application (Server) 3. ASP.NET Client Application (Client) In between the Host and the Server application we have a COM service (Agent) which acts as a mediator between the HOST and the Server system systems. THe Host system sends a message which contains some Chinese characters. This message is recieved by the Agent Service which then converts this message into Big5 Encoding and sends that to the Server Application. The Server Application receives the Big5 encoded message and after performing the required Business Logic forwards the message (Chinese characters (Big5 encoded)) to the Client. The Chinese characters should be displayed in the Browser UI but its displaying the ASCII Equivalent Character of those encoded characters. These characters are displayed in the UI: -Ó¤H³ü¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@
We are running our application in Windows Server 2012 OS. The OS language setting have been set to Chinese (Traditional Taiwan) (Big5). Our Server application also writes trace logs where we can see the below Chinese characters written: 個人壹
When I debugged our Server side code, in Visual Studio watch window it shows me the ASCII equivalent characters (-Ó¤H³ü¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@¡@) but after it has written into the logs we can see the Chinese characters (個人壹) in the log when the OS language setting is Chinese (Traditional Taiwan). However in the UI side while displaying it is not able to display Chinese Characters.
How can we handle this case and display the Chinese Characters in Browser UI?
Tuesday, September 8, 2015 10:50 AM
Answers
-
As far as I know, .NET stores strings in Unicode in memory. Unicode can easily contain any of the Chinese Characters which of the many unicode encodings it uses is an .NET implementation detail.
During transmission or storage, you have to make sure that both sides use the same encoding. A lot of work has been done to make sure the encoding is unambiguously knowable.
Please refer to this article:
Best regards,
Kristin
This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.- Edited by Kristin Xie Wednesday, September 9, 2015 7:45 AM
- Marked as answer by Herro wongMicrosoft contingent staff Tuesday, September 22, 2015 1:19 AM
Wednesday, September 9, 2015 7:43 AM -
If you store 個人壹 as text and open it as "Windows-1252" charset (the default character set for browsers in English environment) using editors such as Notepad++, you'll see the text become "Ó¤Hłü".
Set the Response.ContentEncoding to System.Text.Encoding.UTF8 should cure it.
- Proposed as answer by Kristin Xie Tuesday, September 15, 2015 9:45 AM
- Marked as answer by Herro wongMicrosoft contingent staff Tuesday, September 22, 2015 1:19 AM
Wednesday, September 9, 2015 8:11 AMAnswerer
All replies
-
As far as I know, .NET stores strings in Unicode in memory. Unicode can easily contain any of the Chinese Characters which of the many unicode encodings it uses is an .NET implementation detail.
During transmission or storage, you have to make sure that both sides use the same encoding. A lot of work has been done to make sure the encoding is unambiguously knowable.
Please refer to this article:
Best regards,
Kristin
This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.- Edited by Kristin Xie Wednesday, September 9, 2015 7:45 AM
- Marked as answer by Herro wongMicrosoft contingent staff Tuesday, September 22, 2015 1:19 AM
Wednesday, September 9, 2015 7:43 AM -
If you store 個人壹 as text and open it as "Windows-1252" charset (the default character set for browsers in English environment) using editors such as Notepad++, you'll see the text become "Ó¤Hłü".
Set the Response.ContentEncoding to System.Text.Encoding.UTF8 should cure it.
- Proposed as answer by Kristin Xie Tuesday, September 15, 2015 9:45 AM
- Marked as answer by Herro wongMicrosoft contingent staff Tuesday, September 22, 2015 1:19 AM
Wednesday, September 9, 2015 8:11 AMAnswerer