0

I have a RichTextBox which continuously receives data in JSON dictionary format. (It's a chat program)

However, when receiving unicode characters (or any like these: ç ù é è à) , they literally look like this:

\u0361 \u00b0 \u035c \u0296 \u0361 \u00b0 and get shown like that in the textbox.

I've tried using a few different encodings for the requests (for example StreamReader reader = new StreamReader(webResponse.GetResponseStream(), Encoding.UTF8) , but it either completely messed up the requests or didn't decode them at all.

So, what's the right approach to fixing this problem? What class should I be looking into? Or is anyone kind enough to provide me with a direct solution?

secretformula
  • 6,414
  • 3
  • 33
  • 56
Adam
  • 612
  • 4
  • 13
  • 23
  • 1
    Have you tried logging the data or debugging and inspecting it? – Eric Finn Aug 06 '13 at 12:31
  • 1
    Something along the chain of client->server->storage->server->client is not decoding JSON properly. No idea which step is to blame without code/debugging. – bobince Aug 06 '13 at 14:39
  • @Adam To find out where the problem is. Is it being sent over the network as `\u0361`? Or is your JSON parser doing that? Or is it an output issue? – Eric Finn Aug 06 '13 at 21:26
  • @EricFinn, it's being sent as \uXXXX .. When the data I get back from my GET request contains unicode, it's in that format. – Adam Aug 07 '13 at 07:05
  • @Adam Then you need to convert those escape sequences to Unicode code points. – Eric Finn Aug 07 '13 at 12:16

0 Answers0