0

I am writing a string to a file that has characters like Ԉ and ف.

I want to specify the encoding as UTF-8 and hence I am forced to convert it to bytes, instead of writing as characters, either using OutputStreamWriter or .getBytes("UTF-8").

I am able to save and read the file (and do a sysout in Eclipse console). Of course if I set the file encoding property in Eclipse as UTF-8, I do see my characters like Ԉ and ف.

Now my question is, instead of printing these characters to my console if I pass it to a text field within my Swing application, will it still correctly display the characters? If I distribute my Swing application to another person in Europe (different Windows charset map), will it also correctly display the characters?

1
  • 1
    See also this related Q&A.
    – trashgod
    Commented Dec 29, 2012 at 11:31

1 Answer 1

4

You should be fine. AFAIK, the Java APIs for displaying text in a Swing API are not sensitive to the native OS default character encoding / map.

3
  • +1 agreed but quite be ignored onWindowsXP with Full Language Localizations pack
    – mKorbel
    Commented Dec 29, 2012 at 8:26
  • @mKorbel - I don't understand your comment.
    – Stephen C
    Commented Dec 29, 2012 at 9:40
  • @mKorbel - I still don't understand you.
    – Stephen C
    Commented Dec 29, 2012 at 10:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.