Home  >  Q&A  >  body text

node.js - utf8 转 gb2312的问题

iconv,iconv-lite等都试过,样例代码总是转出来buffer
还是不很理解,各种锟斤拷。

明确一下需求:
从utf8 字符串 转到 gb2312 字符串

PHPzPHPz2764 days ago607

reply all(3)I'll reply

  • 阿神

    阿神2017-04-17 11:34:17

    I was about to talk about iconv-lite... but I was slapped by the original poster...

    The converted buffer must be written to a text file for viewing~ JS is unicode, that is to say, the characters in the memory that you want to correctly perform related string operations are all unicode. In this case, there is no conversion Other encodings.

    reply
    0
  • ringa_lee

    ringa_lee2017-04-17 11:34:17

    May I ask the poster, what method did you finally use to solve this problem

    reply
    0
  • 大家讲道理

    大家讲道理2017-04-17 11:34:17

    How did the original poster solve the problem in the end?

    reply
    0
  • Cancelreply