简体   繁体   English

编译时出错:用于编码 windows-1252 的不可映射字符 (0x90D)

[英]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:在终端中键入javac Main.java时出现编译错误,我得到的消息是:

.\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通过创建名为JAVA_TOOL_OPTIONS的环境变量并将其设置为-Dfile.encoding=UTF8来正确设置您的 Java 编码

Source: https://stackoverflow.com/a/23399955/9758687资料来源: https://stackoverflow.com/a/23399955/9758687

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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