Unicode字符不会在clojure repl中打印(也不会通过响铃http响应)

时间:2013-03-30 19:13:15

标签: tomcat clojure jvm

我在Tomcat 7内部运行的aws ec2实例(3.2.30-49.59.amzn1.x86_64)上的clojure repl中遇到以下问题:

user=> (println "Tiësto")
Ti�sto

当然,我验证我的文件编码是utf-8:

user=> (get (System/getProperties) "file.encoding")
"UTF-8"

......到目前为止,非常好。也许它是一个repl输入问题,所以我逃避输入:

user=> (println "Ti\u00ebsto")
Ti�sto

...现在我尝试将其打印到日志中

user=> (info "Tiësto")
output from the log:
2013-03-30 19:04:06.569 INFO  default    user - Tiësto

大!虽然当通过环形处理程序吐出“Tiësto”时,这个问题仍然存在:

{
 ...
  artists: ["Ti�sto"],
 ...
}

在我的开发环境中(当然)都不会出现这些问题。任何人都知道可能会发生什么?

1 个答案:

答案 0 :(得分:0)

您是否尝试过设置内容类型和字符编码:

response.setContentType("text/html;charset=UTF-8");  
response.setCharacterEncoding("UTF-8");  
out.println(Tiësto);