Unicode strings in my C# App are shown with question marks

Posted by mrbamboo on Stack Overflow See other posts from Stack Overflow or by mrbamboo
Published on 2010-03-23T23:12:33Z Indexed on 2010/03/23 23:13 UTC
Read the original article Hit count: 444

Filed under:
|
|
|
|

Hi,

I have a header file in C++/CLR project, which contains some strings in different languages. arabic, english, german, chinese, french, japanese etc...

I have a second project written in C#. Here I access the strings stored in the header file of the C++/CLR project.

The encoding of the header file is Unicode - Codepage 1200 or UTF-8. the visual studio editor is able to display the strings correctly. At runtime I access these strings and assign them into a local String variable. Here I recognized that many strings are not shown correctly. Doesn't matter if I assign them or not. Accessing the original place (while debugging) shows me all the foreign strings with question marks. Especially chinese, just question marks.

Example : "So?e St?ange ?ext in Ch?n?se" (This is not the best example, I know)

What is the problem? I read that C# is by default UTF-16, My header file containing the strings is UTF-16 or UTF-8.

I must be able to handle strings in different languages. What am I doing wrong?

© Stack Overflow or respective owner

Related posts about unicode

Related posts about c#