Re: illegal line end in character literal in escaped unicode CARRIAGERETURN / NEW LINE
On May 15, 9:51*am, Christian <j...@wispa.de> wrote:
> Hi folks,
> I just stumbled replacing an escaped Unicode of CARRIAGE RETURN / NEW
> LINE and got a compiler-error "illegal line end in character literal"
> switch (original)
> * * * * case '\u000D' : return '\u0020';
use less wide indentation, please.
> * * * * case '\u000A' : return '\u0020';
> To be honest: I don't have the slightest idea what the compiler is
> complaining about. The escape-sequence \u seems to be correct
> according to most of the sources I came across and the two-digited
> hexadecimal encoding cannot be wrong - so what's up here?
You ended the line after the keyword 'case' without giving it a
constant. Bear in mind that Unicode escape sequences are substituted
prior to parsing the source, so for example, your second 'case' is
exactly equivalent to:
' : return ' ';
Do you see how that is not a legal Java syntax?
|All times are GMT. The time now is 03:01 PM.|
Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.