0

I have rather strange problem. I am running the same exactly WPF application on Win7 and XP platform. The application includes wpf listview in which one column presents URL's. The issue arises on XP platform where non-unicode Url's, specifically Chinese or Korean are shown as squares.

While on Win 7 the same data is shown correctly. Need to mention that other non unicode characters like Greek or German are showing correctly on both systems.

Does anybody knows what is going on? Thanks

         // Get the stream associated with the response.
        Stream receiveStream = response.GetResponseStream ();

        // Pipes the stream to a higher level stream reader with the required encoding format. 
        StreamReader readStream = new StreamReader (receiveStream, Encoding.UTF8);
dovid
  • 6,354
  • 3
  • 33
  • 73
Jim
  • 2,760
  • 8
  • 42
  • 66
  • Does [this](http://stackoverflow.com/questions/11293994/how-to-convert-a-utf-8-string-into-unicode) help you at all? – TylerD87 Jan 07 '14 at 11:36
  • Greek and German **ARE** Unicode characters - or rather, they are encoded in Unicode. They aren't US-ASCII characters. Boxes appear when you try to display a non-Unicode string using the wrong encoding or you are using a non-Unicode font. What is the encoding of the data you are trying to display? If the original content has an Encoding header that doesn't match the actual content you'll get boxes due to conversion errors – Panagiotis Kanavos Jan 07 '14 at 11:53
  • The string are Encoding.UTF8, however I am not sure why it is presented differently on Win7 and WinXP? – Jim Jan 07 '14 at 12:01
  • Please add an example URL to the question, or at least part of it if its an internal URL – AlSki Jan 07 '14 at 14:33

1 Answers1

1

It could be the font that is used to display the characters. Can you confirm that you are using the same Font on both systems?

I'm pretty sure the system default font changed from Tahoma to Segoe UI in the change from XP to Win 7.

(Hint you might be able to use character map to check if the font supports the correct characters)

AlSki
  • 6,868
  • 1
  • 26
  • 39
  • I changed ta listview FontFamily to Arial and also set specifically to Segoe UI, whoever it still returns as squeres on Win7 looks just fine:( – Jim Jan 07 '14 at 13:18
  • 2
    Squares are used to indicate that the font doesn't support a particular character – AlSki Jan 07 '14 at 13:20
  • Having looked with character map I can see that *Microsoft YaHei* supports a great range of chinese looking characters including 亗 U+497 CJK Ideograph – AlSki Jan 07 '14 at 13:25
  • Have a look at http://msdn.microsoft.com/en-us/library/vstudio/system.windows.media.fontfamily(v=vs.110).aspx it demonstrates using fallback fonts for when the UI font doesn't have the correct chars. Oh and while searching I saw that people seem to use *Batang* as the normal chinese/japanese font. – AlSki Jan 07 '14 at 14:04
  • I've check the Microsoft YaHei still have squeres.. this is driving me crazy. I am changing the font of the ListView ... should I change anything else? – Jim Jan 07 '14 at 14:30
  • I've also checked the Batang with the same negative result – Jim Jan 07 '14 at 14:43