Re: Unescaping Unicode code points in a Java string
- From: Thomas Fritsch <i.dont.like.spam@xxxxxxxxxxx>
- Date: Thu, 31 Aug 2006 11:46:01 GMT
Greg wrote:
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?
Long time ago I searched the Java API and sources for a method doing that kind of String decoding, but to no avail. The only thing I found was method
private String loadConvert(String)
in class java.util.Properties. But because it is private, it is not reusable outside Properties.
(You find the source in src.zip of JDK installation directory)
--
Thomas
.
- References:
- Prev by Date: Re: Running java programs from class files
- Next by Date: Re: Running java programs from class files
- Previous by thread: Unescaping Unicode code points in a Java string
- Next by thread: Re: Unescaping Unicode code points in a Java string
- Index(es):
Relevant Pages
|
|