Non-ASCII characters and OpenJDK
Joe Darcy
Joe.Darcy at Sun.COM
Fri Aug 7 21:13:21 UTC 2009
On 08/07/09 01:52 PM, Andrew John Hughes wrote:
> I came across an interesting build failure today with b68. It seems
> that the compiler decided to start enforcing -encoding ascii more
> strongly (at least, I see no change to add this option, so maybe it is
> a side-effect of moving to source = 1.7) and thus choked on a couple
> of characters in the Xrender patches IcedTea applies (an umlaut and a
> degree symbol).
>
> Anyone know why this is suddenly enforced? And why is it ascii rather
> than utf8?
>
The fix for 6827026 "Change javac source and target default to 7" added
explicit -source options throughout the JDK build so keep the same build
semantics of -source 1.5. As documented in the javac man page and as I
wrote up recently,
"As an operational difference [between -source 1.5 and -source 1.6],
|javac| handles encoding problems differently under those two source
levels; an encoding problem generates a warning with source 1.5 but is
treated as an error with source 1.6."
http://blogs.sun.com/darcy/entry/source_target_class_file_version
Therefore, after the fix for 6854244 "change source/target used to
compile JDK to 7," encoding problems are treated as errors since a
source setting greater than 1.6 is being used.
One solution to this problem is to set an explicit encoding for the compile:
http://blogs.sun.com/darcy/entry/build_advice_set_source_target
If an explicit encoding is not set, the platform default is used.
-Joe
More information about the discuss
mailing list