Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4071211

Ambiguous definition of octal char encoding

XMLWordPrintable

    • generic, sparc
    • generic, solaris_2.5.1, solaris_2.6

       3.10.6 Escape Sequences for Characters and String Literals
       
      where it talks about OctalEscape:
                
          \ZeroToThree OctalDigit OctalDigit
       
      javac gives a compilation error on "\477".
       
      The string "\477" is questionable, but the grammar
      explicitly allows for:
       
              \OctalDigit OctalDigit
       
      so the \47 fits this rule, and the following 7 is just another character
      in the string.
       
      There is nothing in the JLS that says that "\477" is an error, and the grammar
      allows for it. This could alternately be considered a bug in
      javac when it reports an error on "\477".

            iris Iris Clark
            dstoutamsunw David Stoutamire (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: