Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder2.hal-mli.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Knute Johnson Newsgroups: comp.lang.java.programmer Subject: Unicode escapes and String literals? Date: Thu, 13 Dec 2012 09:31:18 -0800 Organization: A noiseless patient Spider Lines: 14 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 13 Dec 2012 17:31:18 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="9b3fcb0d22708969e4dc99e7aa0ef1f9"; logging-data="15128"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18nai70JyriCyzEk0g/jhnw" User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/17.0 Thunderbird/17.0 Cancel-Lock: sha1:j5Q5thGo/MEeVR3M2ySQouI4F7E= Xref: csiph.com comp.lang.java.programmer:20294 I just had a great revelation as I was putting together my SSCCE for the question I was going to ask. So it has changed my question. How do I do the conversion of unicode escape sequences to a String that are done by string literals? String s = "\u0066\u0065\u0064"; becomes "fed" but if you create a String with \u0066\u0065\u0064 in it without using the literal it stays \u0066\u0065\u0064. Is there a built in mechanism in Java for doing that translation to a String? -- Knute Johnson