V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
tame619
V2EX  ›  Java

windows 服务器 tomcat 启动为 GBK 编码,导致乱码

  •  
  •   tame619 · Dec 4, 2020 · 2572 views
    This topic created in 1969 days ago, the information mentioned may be changed or developed.

    windows 有两种方式:一种 startup.bat,我修改一些文件配置,启动是 utf-8 编码。但是另一种:tomcat9w.exe ,修改的配置文件不起作用,启动后是 gbk 编码,请问如何修改?

    3 replies    2020-12-04 20:43:14 +08:00
    thetbw
        1
    thetbw  
       Dec 4, 2020 via Android
    编码不是自己项目里配置吗,或者弄个 filter 处理自己项目全局编码
    msana
        2
    msana  
       Dec 4, 2020
    log 日志改成 gbk 就行了~
    tame619
        3
    tame619  
    OP
       Dec 4, 2020
    @thetbw 我也试过全局处理,不过处理的是我的接口。我是要请求别人的接口,我发送给他人接口编码是 GBK,然后显示就是乱码了。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   6113 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 57ms · UTC 02:45 · PVG 10:45 · LAX 19:45 · JFK 22:45
    ♥ Do have faith in what you're doing.