|
|
|
|
Re: utf-8 encoding [message #733417 is a reply to message #733271] |
Tue, 04 October 2011 16:50 |
Larry Isaacs Messages: 1354 Registered: July 2009 |
Senior Member |
|
|
On 10/4/2011 11:32 AM, linen wrote:
> I've tried to add arguments to the runtime profile for Java. I'm using
> Eclipse Helios.
> Eclipse -> Preferences -> Java -> Installed JREs
> I select the JRE, click "Edit" and I have added the following to the
> text field "Default VM Arguments" -> -Dfile.encoding=UTF-8.
> I've also added that to the bottom of the eclipse.ini file in the
> Application Bundle in Mac OS X. I restarted my computer. But I still
> don't see proper character formatting. I'm just confused about how to
> set encoding for a Java application. I can choose "Irish Extended" from
> the Character Palatte, which I've set up inside of System Preferences on
> OS X. I can type Irish including the Irish fada directly into the
> Eclipse editor. And I can type Irish and the fada directly into the
> console. So I know the font is fine, and I know that Eclipse can display
> the character. It just isn't showing up in when I run the Java
> application. And I don't know what I'm missing or failing to understand.
Since you say you are running your application within Eclipse, I'm going
to guess that you are looking at the output in the Console window. If
this is correct, setting the "-Dfile.encoding=UTF-8" on the JRE tells
the JVM what encoding you want. However, it doesn't tell the Console
view what encoding to expect. In this case, instead of setting the
"Default VM Arguments", you want Run -> Run Configurations. Select the
launch configuration under the Java Application category. On the Common
tab, select the encoding in the Encoding section. This will set the
"file.encoding" system property for the JVM and tell the Console view to
expect that encoding. If I've guessed wrong, please specify where you
are viewing the incorrect output. I'm not sure how else to interpret
"view output in Log 4 J".
Cheers,
Larry
|
|
|
|
Powered by
FUDForum. Page generated in 0.03485 seconds