我是 Java 的新手,所以如果这是一个非常简单的问题,请多多包涵。我有一个 JUnit 测试,其中我有一个硬编码的日语单词直接分配给一个字符串变量。现在在分配该字符串之后,它变成“??” 意味着编码在某处不正确。
public class TestTest extends TestCase {
public void testLocal(){
Locale.setDefault(Locale.JAPAN);//same problem with or without this line
String test = "会社";
//after this line, by watching at the debugger, the variable "test" contains "??"
assertEquals("会社", test);
}
}
因为这是一个测试用例,我相信它将问题与其他 UI 环境完全隔离开来。请帮助我。2天没有解决。先感谢您。