0

I wrote an app that get a string from a server, this string is not in English so the server sends a string that represents the Unicode values of the characters.

Is there a method in some class that takes a string representing a Unicode value (string of the format "\uXXXX") and returns the Unicode character corresponding to this value?

I tried the answers for the other questions. When I tried it on a regular project it worked but on mt android app it causes the app to stop working.

Dor Mesica
  • 507
  • 1
  • 7
  • 23
  • 2
    I would use UTF-8 to encode and decode the String. Using the `\uXXXX` only makes sense in Java code IMHO. – Peter Lawrey Dec 19 '13 at 09:51
  • There are many string formats that use `\u`. What format is the server supposed to be returning to you? If it's JSON, which seems most likely, you should use a standard JSON parser, which will take care of turning string literal escapes like `\u` into normal Unicode characters. – bobince Dec 19 '13 at 09:57

1 Answers1

1

If you know what Unicodes you want to eliminate, you should use replace("\uXXXX","") method.

thedarkside ofthemoon
  • 2,251
  • 6
  • 31
  • 48