Reputation: 1610
I am localizing my application and through it there are messageboxes to alert the user of certain things. When I include chinese characters in text areas they look like a bunch of squares when debugging in VS2010 but then are converted to the proper characters when displayed in the UI through objects bound to properties. But when the code directly calls messagebox.show("chinese characters") it ends up just displaying a bunch of empty squares. Why is this?
Upvotes: 0
Views: 404
Reputation: 941327
There is no such thing as "double bytes" in Silverlight. All strings are encoded in utf-16. Double bytes is a hack from the days of 8-bit code pages to find a way to encode CJK text. You will have to convert such encoded text to utf-16 with the Encoding class.
Seeing text displayed as squares can be because the characters are control codes due to a bad encoding. Or missing support for the glyphs in the fonts installed on the machine. That's a rapidly disappearing problem too, you'd normally only have it on XP without East Asian font support installed.
Upvotes: 2