Home  >  Q&A  >  body text

node.js - 渲染 mysql查询到的数据,中文乱码怎么解决?

高洛峰高洛峰2742 days ago672

reply all(2)I'll reply

  • PHPz

    PHPz2017-04-17 16:30:02

    Start checking from several places

    1.后台打印出查询结果、看是否乱码
    2.前台network控制台中查看请求、看是否乱码
    3.JS中打印、看是否乱码
    

    Check in order. If there is a problem in the first step, it is a problem with mysql settings. If there is a problem in the next two parts, you should also know how to deal with it

    reply
    0
  • 迷茫

    迷茫2017-04-17 16:30:02

    If it is a mysql query statement-try this

    CONVERT(xxx USING utf8)

    reply
    0
  • Cancelreply