Unescaping Unicode code points in a Java string



My Java program reads in (from an external source) text that contains
the same sort of unicode character escape sequences as java source
code. For example, one such string might be:

"En Espa\u00f1ol"

Naturally, I would like to convert the five characters subsequence,
"\u00f1", into the single character codepoint (hex 00F1) that those
characters actually represent:

"En Español"

I've been browsing the J2SE 1.5 docs hoping to find a convenient method
to perform this kind of conversion, but so far have not found one. Does
anyone have any suggestions?

Thanks,

Greg

.



Relevant Pages

  • Re: Dont do this at home
    ... > a java program for example. ... will turn them into the corresponding unicode character. ... just a special case of character escapes, ... The difference is that the unicode escapes are processed before the ...
    (comp.lang.java.programmer)
  • Re: How to exclude a string using regexp pattern?
    ... >> From the following log.txt file, if I want to remove the other strings ... >> Or I have to create a new java program to do this? ... > negated character classes, ... That part of the regex will match everything up ...
    (comp.lang.java.programmer)
  • Re: Printing £ to the console
    ... but I can't get a java program to print the £ ... > know the console knows about such a character. ... Mike W ...
    (comp.lang.java.help)
  • Printing £ to the console
    ... but I can't get a java program to print the £ ... know the console knows about such a character. ... Robin Shuff ...
    (comp.lang.java.help)