tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Labanowski <>
Subject \u000d is not a valid char constant, Was: Tomcat bug
Date Mon, 05 Jun 2000 00:17:17 GMT

> > > This is not a valid Java statement:
> > > 
> > > 	char c = '\u000d';
> > > 
> > > because the '\u000d' is not a valid character constant.

Thank you gurus... I now remember reading about it when I was
going through the textbook a year ago. But of course, I have good memeory 
only short...

At the same time, I hoped that Java will be a nice language to program,
without the need to remember that
     char c = '\u000e';
     char c = '\u1234';

is a valid statement and the 

     char c = '\u000d';
     char c = '\u000a';

is a bug...

But here it comes... another thing to remember. 
Someone asked why I need this... 
I need this to get the ^M out from TEXTAREA and to convert the
String to contain only UNIX EndOfLine(^J) since some UNIX code which
I have, chokes on ^M and dumps core (I did not write it).
Of course there are many ways of doing this. What I did
is use the charAt(), compare, skip if ^M, put it to
CharArray, and put it back to String. There is probably a 1000
classes in 1000 packages which do that, but sometimes it is faster
to write it than to find it (the paradigm of code reuse {;-)} .
Of course I solved the problem by doing 
  char c = 13;
What I forgot is the early character conversion thing in Java.

Thanks for all of you for your comments...


Jan K. Labanowski            |    phone: 614-292-9279,  FAX: 614-292-7168
Ohio Supercomputer Center    |    Internet: 
1224 Kinnear Rd,             |
Columbus, OH 43212-1163      |

View raw message