我是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环境隔离开来。请在这方面帮助我。已经两天了还没有解决方案。提前感谢您的帮助。