简体   繁体   English

如何在TOMCAT8中更新UNICODE版本

[英]How to update UNICODE version in TOMCAT8

I'm using Emojis in a web application, for test I'm using jetty 8.1.8 and work it very well, however I put my webapp in tomcat 8 and not work it, I read about this and find it is because my version of UNICODE is not update, my question is How can I update it? 我在一个Web应用程序中使用Emojis,测试我正在使用jetty 8.1.8并且工作得很好,但是我将我的webapp放在tomcat 8中并且不能正常工作,我读到了这个并且发现它是因为我的版本UNICODE没有更新,我的问题是如何更新它?

Thanks. 谢谢。

You can add URI Encoding property to your connector. 您可以将URI编码属性添加到连接器。

In your Tomcat distribution's conf/server.xml file, find the connector definition for your HTTP protocol and add at the end of the connector URIEncoding="UTF-8" like so. 在Tomcat发行版的conf / server.xml文件中,找到HTTP协议的连接器定义,并在连接器的末尾添加URIEncoding="UTF-8"如下所示。

<Connector port="8080" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true" URIEncoding="UTF-8"/>

Alternatively you can set encoding via system property -Dfile.encoding=utf-8 或者,您可以通过系统属性-Dfile.encoding=utf-8设置编码

The Unicode version does not depend on the Tomcat version, but on the Java version. Unicode版本不依赖于Tomcat版本,而是依赖于Java版本。 Do you use the same Java version for both Jetty and Tomcat? 您是否为Jetty和Tomcat使用相同的Java版本?

And where in the code and how do you access the Unicode information? 代码中的位置以及如何访问Unicode信息? Maybe it helps to implement that part using IBM's icu4j, which can be updated independently of the Java version. 使用IBM的icu4j可能有助于实现该部分,icu4j可以独立于Java版本进行更新。

The problem is the pageEncoding UTF-8. 问题是pageEncoding UTF-8。 I had to use other encoding in my jsp only when I use the emoji, the encoding that work for me is ISO-8859-8. 我只能在使用表情符号时在jsp中使用其他编码,对我有用的编码是ISO-8859-8。

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

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