Java webstart character encoding issues


Question

I have a JavaFX/Groovy application that I'm trying to localize.

It turns out that when I use JavaFX standard execution with the Java VM arg "-Dfile.encoding=UTF-8" locally, all of my international characters (for example, ü) display correctly.

However, if I invoke the app via a JNLP file, using java-vm-args="-Dfile.encoding=UTF-8" e.g.

<resources>
    <j2se version="1.6+" java-vm-args="-Dfile.encoding=UTF-8"/>
    ...other stuff...
</resources>

The application shows international characters as a couple of other random characters (like √¬).

Am I specifying the file encoding incorrectly in the JNLP, or is there some difference between Standard Execution and Webstart that affects this?

Much Appreciated.

EDIT: I am using a Groovy API to access the Remember The Milk RESTful web service. All text that is problematic will come from data retrieved (like task names) and is not actually stored on disk in binary or text. It's curious that "-Dfile.encoding=UTF-8" would actually fix it locally.

1
3
4/21/2015 12:26:30 PM

I would strongly advise you to explicitly specify the encoding everywhere you're going to be converting text to binary or vice versa. Relying on the JVM default - even after you've set that default - doesn't feel like a good idea to me. You haven't really said what you're doing with text, but if you explicitly set the encoding when you save or load, it should be fine.

4
7/9/2010 3:13:20 PM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon