Path: csiph.com!usenet.pasdenom.info!news.albasani.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: markspace <-@.> Newsgroups: comp.lang.java.programmer Subject: Re: Unicode escapes and String literals? Date: Thu, 13 Dec 2012 12:58:09 -0800 Organization: A noiseless patient Spider Lines: 18 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 13 Dec 2012 20:58:12 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="61282af8d6595e8d991edb5ac03d6e00"; logging-data="27864"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/M46DMj1tYIMZmTW9CG567KdYNaisgB28=" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 In-Reply-To: Cancel-Lock: sha1:O0JC8S8MtW4zo9XQ3Em2raYMffY= Xref: csiph.com comp.lang.java.programmer:20300 On 12/13/2012 10:47 AM, Knute Johnson wrote: > > I want to be able to do it to a String not to a string literal. > Daniel showed one way to interpret your request. Here's another. Pay special attention to the bits out side the quotes. This program prints "fed". public class EscapeTest { public static void main(String[] args) { String \u0066\u0065\u0064 = "\u0066\u0065\u0064"; System.out.println( fed ); } }