Encoding issue on filename with Java 7 on OSX with jnlp/webstart

后端 未结 5 1191
孤街浪徒
孤街浪徒 2021-02-05 22:31

I have this problem that has been dropped on me, and have been a couple of days of unsuccessful searches and workaround attempts.

I have now an internal java swing prog

5条回答
  •  旧时难觅i
    2021-02-05 22:54

    Shot in the dark: File Encoding does not influence the way how the file names are created, just how the content gets written into the file - check this guy here: http://jonisalonen.com/2012/java-and-file-names-with-invalid-characters/

    Here is a short entry from Apple: http://developer.apple.com/library/mac/#qa/qa1173/_index.html

    Comparing this to http://docs.oracle.com/javase/tutorial/i18n/text/normalizerapi.html I would assume you want to use

    normalized_string = Normalizer.normalize(target_chars, Normalizer.Form.NFD);

    to normalize the file names before you pass them to the File constructor. Does this help?

提交回复
热议问题