How does nodejs convert utf-8 characters into gb2312

  node.js, question

I need to post a set of data to a website. The target website only receives gb2312 code. The rest of the connections were scrambled.
How does nodejs convert utf-8 characters into gb2312?

var iconv = require('iconv-lite');
 Var str =' hello';
 str = iconv.encode(str,'utf8');
 str = iconv.decode(str,'GB2312');
 str = str.toString();
 console.log(str);

This is not going to work. Seek guidance

I’ve met it before. You can look at thishttp://web-engineer.cn/article/29