Received: by 10.66.86.130 with SMTP id p2mr1007943paz.22.1355447467872; Thu, 13 Dec 2012 17:11:07 -0800 (PST) Received: by 10.50.7.198 with SMTP id l6mr29946iga.3.1355447467832; Thu, 13 Dec 2012 17:11:07 -0800 (PST) Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.linkpendium.com!news.linkpendium.com!news.snarked.org!newsfeed.news.ucla.edu!usenet.stanford.edu!kt20no1444299pbb.1!news-out.google.com!6ni43505pbd.1!nntp.google.com!kr7no175357pbb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.java.programmer Date: Thu, 13 Dec 2012 17:11:07 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=69.28.149.29; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T NNTP-Posting-Host: 69.28.149.29 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <8dbfcaee-b736-40f7-ae16-ea7fb7e4ac00@googlegroups.com> Subject: Re: Unicode escapes and String literals? From: Lew Injection-Date: Fri, 14 Dec 2012 01:11:07 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: csiph.com comp.lang.java.programmer:20316 markspace wrote: > David Lamb wrote: >> Cute. But presupposing that the OP isn't the idiot some people seem to > > have assumed, I suspect he meant something more like >> >> String line = someBufferedFile.readline(); >> ... change all \u escapes into unicode in "line" ... [1] That was not obvious to me, hence my question as to what he did mean. > Maybe. But your code above is obvious, imo. Either Knute had a brain > fart and forgot about \\ to escape a slash, or he ran into some other > problem. > > My point was that there's a very simple pre-compiler for Java. It > translates all \u-escapes into characters before the compiler proper > sees it. There's no difference to the Java compiler between "fed" and > "\u0066\u0065\u0064". It literally can't tell the difference. That was also the point of my SSCCE. > That's an important distinction. -- Lew