Hi Ian,

There is a JAR in the JVM containing the code pages and encoding
conversions - I think it is called charsets.jar. It isn't always
installed by default but you'll need it for CJK encodings.

If missing then the Java libraries will find CJK text and try to decode
it, but will then fail as the encoding conversion code is missing. The
error message you've got sounds about right for this problem.

HTH

Martin



On Mon, 2008-11-24 at 08:48 -0800, Ian Kaplan wrote:
> Hi Martin,
> 
>   Locale looks like a hack.  Apparently it's possible to set the Locale
> globally, which I'm a bit surprised by.  I would have expected that it would
> be set on an application level.  But it's quite possible that I don't
> understand all of the complexities.  I did find this code, which looks
> promising:
> 
> /**
>  * @(#) SetDefaultLocale.java
>  * A class representing use of method setDefault() of Locale class
>  in java.util Package.
>  * @Version  24-May-2008
>  * @author   Rose India Team
>  */
> *import *java.util.*;
> 
> *class *SetDefaultLocale {
>     *public static **void *main( String args[] ){
> 
>         /* Create object of Locale class using contructor
>            Locale(String language, String country) */
>       Locale objLocale = *new *Locale("CH","CHINA");
>       // getDefault() method call. This is static method.
>         Locale locale = Locale.getDefault();
>         System.out.println("current default locale is : " + locale);
>         // setDefault() method call. This is static method.
>     Locale.setDefault(objLocale);
>     System.out.println("##.....Set default locale successfully !");
>     locale = Locale.getDefault();
>         System.out.println("Now default locale is : " + locale);
>   }
> }
> 
> 
>   Thank you again for your help.  Best regards,
> 
>   Ian
> 
> On Mon, Nov 24, 2008 at 8:19 AM, Martin Brown <[EMAIL PROTECTED]>wrote:
> 
> > Hi Ian,
> >
> > >   I have written some Java code very much like the HPSF example on the
> > HPSF
> > > HOW-TO <http://poi.apache.org/hpsf/how-to.html> page which reads
> > Microsoft
> > > Office document property (or metadata) information.  This code works fine
> > > for documents that have been saved with English versions of Microsoft
> > > Office.  However, when I try to use it with a Microsoft document that is
> > > saved with a Chinese version, the code fails.  I get an exception and the
> > > only message is "GBK".  I assume that this is referring to the character
> > > set.
> >
> > You do have all the Java locale data installed? The Windows JRE doesn't
> > do this by default and this has tripped me up in the past.
> >
> > HTH
> >
> > Martin
> >
> >
> > Filtered by 3BClean from http://www.3bview.com
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >


Filtered by 3BClean from http://www.3bview.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to