Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why did Java change Japanese native encoding in Leopard? (Radar #5015600)



I am making a wild guess here, but I suspect that Apple wants to make UTF-8 the system wide character set, no matter the locale.

You shouldn't really make any assumptions about the character set being used. The best approach is to get the value from the system property "file.encoding". I have seen too many issues where people expected the character set to be X, redeployed and found the character set to be Y. UTF-16 is the only constant, since this is used internally by Java. If you need to control the character set, then classes like java.io.InputStream allow you to specify the encoding you wish to use.

Andre


On 27-Feb-08, at 18:41 , Michael Good wrote:

Dear list,

After getting some bug reports from Japanese users of our mixed Java /
C++ plug-in for an old non-Unicode Carbon application, I discovered a
reference Radar #5015600 in the Java 10.5 release notes:

"Java 1.5 uses ShiftJIS encoding when the primary language is Japanese

Description:
By default, Java 1.5 would use ShiftJIS encoding when the primary
language is set to Japanese. Now it uses UTF-8.

Resolution:
This problem is now fixed."

Can anyone explain why this was considered a problem that needed to be
fixed? It has broken our application on Leopard.

Why should Java's native encoding be different than the result from
CFStringGetSystemEncoding()? That did not change in Leopard - it still
is kCFStringEncodingMacJapanese on both 10.4.11 and 10.5.2. Shift_JIS
is the Java encoding that is closest to kCFStringEncodingMacJapanese.
UTF-8 is totally different!

Before trying to fix our application to deal with this incompatible
change in Leopard, it would be great to understand the rationale for
the change. At the moment it sure seems like a bug in Leopard rather
than a bug fix.

Thanks for any insight!

Michael
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden
References: 
 >Why did Java change Japanese native encoding in Leopard? (Radar #5015600) (From: "Michael Good" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.