A Mon, 20 Jun 2005 02:59:03 GMT, Dale King
<DaleWKing@insightbb.nospam.com> escribió:
> Putting any non-ASCII character into a Java source file without escaping
> it is a very bad idea. It means that your code can have different
> behavior depending on which machine the code is compiled on. The Java
> source file is just a stream of bytes. That stream must be translated
> into characters using some character encoding.
That's why I immediately went to the platform vendor. They
provide us a facility to bring XML data into our
application. They assured me that they read the encoding
from the XML file (in this case "windows-1250") and use
that. I confirmed what you suggested, that 0x92 is
converted to 0x2019, so it seems they're doing the right
thing there.
> If it is a bug in 1.4.2 it is probably that it did not properly handle
> the full Unicode set for negated character classes. I see bug 4872664
> <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4872664> in the
> database that sounds exactly like what you descrbe, but it was
> supposedly fixed in 1.4.2_04.
Thank you! I just checked my IDE, and I'm using
JDK1.4.2_01. I have JDK1.4.2_08 installed on my unit test
box, but all our customers have JVMs at 1.4.2_01 and all the
rest of my team is on JDK1.4.2_01. This must be the problem
we're encountering. I'll have everyone upgrade.
--
bicker®
Dale King - 21 Jun 2005 04:14 GMT
> A Mon, 20 Jun 2005 02:59:03 GMT, Dale King
> <DaleWKing@insightbb.nospam.com> escribió:
[quoted text clipped - 12 lines]
> converted to 0x2019, so it seems they're doing the right
> thing there.
The character conversion I was talking about had nothing to do with your
XML vendor, but in the java compiler. Your example showed this line:
strInput = "’";
which had the byt 0x92 in it. How the compiler handles that will differ
from one platform to another. In reality you probably don't have that
text in your program, but it comes from your XML parser, but I just
wanted to make sure you knew that anything other than ASCII may not work
like you think it will in a Java source file.
>>If it is a bug in 1.4.2 it is probably that it did not properly handle
>>the full Unicode set for negated character classes. I see bug 4872664
[quoted text clipped - 7 lines]
> rest of my team is on JDK1.4.2_01. This must be the problem
> we're encountering. I'll have everyone upgrade.
In the future when you suspect a bug you might want to do what I did and
search the bug database.

Signature
Dale King
*bicker* - 21 Jun 2005 12:04 GMT
A Tue, 21 Jun 2005 03:14:34 GMT, Dale King
<DaleWKing@insightbb.nospam.com> escribió:
> > Thank you! I just checked my IDE, and I'm using
> > JDK1.4.2_01. I have JDK1.4.2_08 installed on my unit test
[quoted text clipped - 3 lines]
> In the future when you suspect a bug you might want to do what I did and
> search the bug database.
To be honest, I was still convinced that either we or our
vendor was doing something wrong. I'll be sure to not make
such a hasty conclusion again! <grin>
--
bicker®