NutzCN Logo
精华 nutzwk,jetty 开发环境不乱码,换tomcat8就乱码,mysql数据库
发布于 2960天前 作者 x55admin 2287 次浏览 复制 上一个帖子 下一个帖子
标签: 乱码

server.xml中配置了:

<Connector port="8011" protocol="AJP/1.3" redirectPort="8448" URIEncoding="UTF-8"/>

也配置了:

<Connector port="8888" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8448" 
               maxThreads="1200" minSpareThreads="120" maxSpareThreads="300"
               enableLookups="false"  acceptCount="100" debug="0" 
               disableUploadTimeout="true" URIEncoding="UTF-8"
               />

IDEA启动也配置了:

-Dfile.encoding=UTF-8

mysql也配置了:

character-set-server=utf8
default-character-set=utf8 

可还是乱码

3 回复

入库的时候乱码? GET请求?

@wendal

2016-11-14 21:34:12,392 org.nutz.mvc.impl.NutLoading.evalUrlMapping(NutLoading.java:220) INFO  - Found 349 module methods
2016-11-14 21:34:12,392 org.nutz.mvc.impl.NutLoading.evalLocalization(NutLoading.java:306) DEBUG - Localization: org.nutz.mvc.impl.NutMessageLoader('locales/')  dft<zh_CN>
2016-11-14 21:34:12,395 org.nutz.resource.Scans.scan(Scans.java:262) DEBUG - Found 6 resource by src( locales/ ) , regex( ^.+[.]properties$ )
2016-11-14 21:34:12,395 org.nutz.mvc.impl.NutMessageLoader.load(NutMessageLoader.java:27) DEBUG - Load Messages in 6 resource : [[NutResource[en_US/sys/role.properties], NutResource[en_US/sys/unit.properties], NutResource[en_US/system.properties], NutResource[zh_CN/sys/role.properties], NutResource[zh_CN/sys/unit.properties], NutResource[zh_CN/system.properties]]]
2016-11-14 21:34:12,398 org.nutz.mvc.impl.NutMessageLoader.load(NutMessageLoader.java:95) DEBUG - Message Loaded, size = 3
2016-11-14 21:34:12,399 org.nutz.mvc.impl.NutLoading.createSessionProvider(NutLoading.java:413) INFO  - SessionBy --> org.nutz.integration.shiro.ShiroSessionProvider@534a1d21
2016-11-14 21:34:12,399 org.nutz.mvc.impl.NutLoading.evalSetup(NutLoading.java:274) INFO  - Setup application...
2016-11-14 21:34:12,399 cn.wizzer.common.core.Setup.init(Setup.java:40) DEBUG - 鍒濆鍖栧紑濮嬧�︹��
2016-11-14 21:34:12,399 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'dao'<interface org.nutz.dao.Dao>

初始化就开始乱码

@wendal 已解决,不知为何,android,用的Retrofit 在jetty Geg, Post请求情况下没出现乱码,但是,tomcat8就出现了乱码,后来server.xml配置了

<Connector port="8888" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8448" 
               maxThreads="1200" minSpareThreads="120" maxSpareThreads="300"
               enableLookups="false"  acceptCount="100" debug="0" 
               disableUploadTimeout="true" URIEncoding="UTF-8"/>

并且:去掉
IDEA启动也配置了:

-Dfile.encoding=UTF-8 配置
get乱码情况解除,控制台保持GBK格式不乱码了。
但是android的post请求乱码,遂怀疑是Retrofit 问题,查百度,找到文章http://blog.csdn.net/dao2012/article/details/52639310
解决此问题

添加回复
请先登陆
回到顶部