search

Home  >  Q&A  >  body text

servlet - Java中使用io流读取文件内容却出现乱码问题

PHPzPHPz2803 days ago3083

reply all(3)I'll reply

  • ringa_lee

    ringa_lee2017-04-18 10:38:06

    Use request.getCharacterEncoding() first to see what code you get.

    reply
    0
  • 黄舟

    黄舟2017-04-18 10:38:06

    First check what encoding is used and convert accordingly

    reply
    0
  • PHP中文网

    PHP中文网2017-04-18 10:38:06

    I now know the reason, that is, when saving the txt file, it must be encoded in UTF-8!

    reply
    0
  • Cancelreply