Ant encoding problem on Windows - UTF-8 files but spits garbage on diacritics

后端 未结 5 727
我寻月下人不归
我寻月下人不归 2020-12-15 17:38

Somehow I can\'t get my UTF-8 sources to play nice with Ant.

I get a whole lot of \"warning: unmappable character for encoding ascii\". I\'m going crazy, really. Hou

5条回答
  •  独厮守ぢ
    2020-12-15 18:24

    Are you specifying the file encoding to the compiler correctly? The java compiler will otherwise default to use the platform's default encoding, which on Windows (for example) is not UTF-8. The encoding is specified by using the -encoding flag to javac.

    javac -encoding utf8 ...
    

    And in ant build.xml:

    
    

提交回复
热议问题