问题已更新
我正在为我的项目使用解析和Parse4J (https://github.com/thiagolocatelli/parse4j),我得到了这个奇怪的行为。我在在线数据库中有这句话(我正在使用Excel解析器上传问题,但我认为在这种情况下它并不重要,因为上传是OK的,问题在互联网上看起来很正常-解析web界面)我看到了这个:
Somebody who is boastful can be described as a ….?对于上载,我使用
put("Question", question);
System.out.println(question);我得到了与上面相同的结果(正确的形式)
最后是三个点,在解析上看起来很正常,但如果我使用getString() - clasical方法来解决这个问题,我会得到
public String getQuestion(){
String question = getString("Question");
System.out.println(question);
return question;
}我得到了
Somebody who is boastful can be described as a ….?有趣的是,我没有在Android上得到这一点(我在Android上使用几乎相同的代码)
有没有什么方法可以摆脱它(设置这个编码或者从parse中删除它?)谢谢
发布于 2015-08-06 18:31:34
我尝试了下面的代码:
try {
row.createCell(id_cell++).setCellValue(new String(q.getQuestion().getBytes(),"UTF-8"));
} catch (UnsupportedEncodingException ex) {
ex.printStackTrace();
}并且输出是正确的,所以我认为这是因为错误的默认编码(可能是Windows-1250)
https://stackoverflow.com/questions/31817054
复制相似问题