Re: regular expressions




"Chris Uppal" <chris.uppal@xxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:444f5db2$1$653$bed64819@xxxxxxxxxxxxxxxxxxxx
Oliver Wong wrote:

To test whether a given unicode character is outside of (or inside of,
for that matter) ASCII, you could serialize it to ASCII, then re-read the
ASCII data back into an in-memory Java string, and check if you still have
the same original character that you started with.

What's wrong with just testing whether it's < 128 ?

Erm, er... I was trying to write code that didn't depend on the internal encoding being UTF-16. Yeah, that's it. More robust and all that. I mean, what if in Java 7, they decide to switch to EBCDIC internally, huh?

- Oliver

.