views:

739

answers:

2

Is there a unicode debug visualizer in Visual Studio 2008? I have a xml file that I'm pretty sure is in unicode. When I open it in wordpad, it shows the japanese characters correctly. When I read the file into a string using File.ReadAllText (UTF8), all the japanese characters show up as blocks in the string visualizer. If I use the xml visualizer, the characters show up correctly.

A: 

You say it's Unicode, so why not use File.ReadAllText(Encoding.Unicode) then?

Duncan Smart
+1  A: 

If you're getting square blocks, rather than complete garbage, you probably just need to specify a more suitable font in Visual Studio (in Tools | Options | Fonts and Colors). Try MS Gothic or MS Mincho (both Japanese fonts); I am guessing your issue can be resolved by tweaking the settings for [Watch, Locals and Autos Tool Windows], but it could be somewhere else.

Not all applications magically font-link to a font that contains the characters you want to display.

JasonTrue