>>>>> "Guido" == Guido van Rossum <guido at cnri.reston.va.us> writes: Guido> Should \uDDDD be added? That'd be nice! :) Guido> In Java, \u has the additional funny property that it is Guido> recognized *everywhere* in the source code, not just in Guido> string literals, and I believe that this complicates the Guido> interpretation of things like "\\uffff" (is the \uffff Guido> interpreted before regular string \ processing happens?). No. JLS section 3.3 says[1] In addition to the processing implied by the grammar, for each raw input character that is a backslash \, input processing must consider how many other \ characters contiguously precede it, separating it from a non-\ character or the start of the input stream. If this number is even, then the \ is eligible to begin a Unicode escape; if the number is odd, then the \ is not eligible to begin a Unicode escape. and this is born out by example. -------------------- snip snip --------------------Uni.java public class Uni { static public void main(String[] args) { System.out.println("\\u00a9"); System.out.println("\u00a9"); } } -------------------- snip snip --------------------outputs \u00a9 © -------------------- snip snip -------------------- -Barry [1] http://java.sun.com/docs/books/jls/html/3.doc.html#44591 PS. it is wonderful having the JLS online :)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4