Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: SWT app UTF8 problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SWT app UTF8 problem



Hi

I've had a similar mysterious problem a few months back.  It turns out that the default character encoding for Macs is "MacRoman", and this is what you get when your run from the command line using "java -jar".  However, under other conditions, the default char encoding can be something else, such as UTF-8, or UTF-16.  Maybe this is what is happening when you use javaws?  This would mean that running the same program in different ways gets you different character encodings.  That is what happened to me.

I wasn't using SWT when I discovered this - I was using a Scanner to read lines of input from a text file.  I found a quick and dirty solution was to always specify UTF-8 as the encoding when opening Scanners and writing files.  I don't know if there's a similar quick and dirty fix for your problem, but I hope you'll know now where to start looking.

Bob
--
On 16 Nov 2010, at 16:30, Kácsor István - Parola Kft. wrote:

> Dear List,
>
> We have an SWT application, that when run from the console using "java -jar
> ." behaves as expected, but when we run it through its jnlp file (like
> "javaws something.jnlp"), the text input fields behave strangely. When
> entering an "á" character (aacute) it gets converted to some other 1 byte
> code page (as we saw the 0x87 byte in the sent form data), that causes an
> exception like this:
>
> org.apache.axis2.AxisFault: com.ctc.wstx.exc.WstxIOException: Invalid UTF-8
> start byte 0x87 (at char #231, byte #127)
>
> We suspect it is a problem in the environment that javaws creates for the
> java executable, but we ran out of ideas on what else we could check.
> Any help would be greatly appreciated!
>
> Regards,
>
> Kacsor
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Java-dev mailing list      (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> 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:

This email sent to email@hidden

References: 
 >SWT app UTF8 problem (From: Kácsor István - Parola Kft. <email@hidden>)



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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.