简体   繁体   中英

Error when compiling: unmappable character (0x90D) for encoding windows-1252

I get compile error when typing javac Main.java in terminal and the message i get is:

.\Constants.java:32: error: unmappable character (0x9D) for encoding windows-1252.

I know it caused by this bit of code:

public static final String[] UNICODE_TEXT = {
      "― ", // CELL_EMPTY
      "✗ ", // CELL_X
      "𝑂 ", // CELL_O
      "  ", // CELL_INVALID
  };

It is the "✗ " and the " " that causes this problem since they are special characters. I don't want to change the code since it was provided by the course. How can I compile this?

Do set your Java Encoding correctly by creating the environment variable called JAVA_TOOL_OPTIONS and set it to -Dfile.encoding=UTF8

Source: https://stackoverflow.com/a/23399955/9758687

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM