node.jsă§ăĄăźăŤé俥ăăéăŽăă¨ăłăłăźăăŁăłă°ăŤiconvă使ç¨ăăăŽă ăăŠă
ĺ¤ć寞蹥ćĺĺăŤISO-2022-JPăŤĺĺ¨ăăŞăćĺďźâ ă¨ăâ
¤ă¨ăďźăĺĺ¨ăăĺ ´ĺă
Error: EILSEQ, Illegal character sequence
ă¨ăăă¨ăŠăźăĺşăŚăăă
try {
var Iconv = require('iconv').Iconv;
// UTF-8ăăISO-2022-JPă¸ĺ¤ć
var iconv = new Iconv('UTF-8', 'ISO-2022-JP');
return iconv.convert(str).toString();
} catch (e) {
console.log(str);
console.log(e);
throw e;
}
var iconv = new Iconv('UTF-8', 'ISO-2022-JP');
ăăăŽćĺŽăćŞăăżăăă§ă
//IGNOREďźçĄčŚăăďź
ăĺż čŚăăăŽăžăžăŽćĺłă§ăĺĺ¨ăăŞăćĺăćĽăŚăçĽăăăľăăăăăŁăŚăă¨ă§ă
ă¨ăŠăźăăŻăăŞăăŞăă
ć´ăŤăăä¸ă¤ăäžżĺŠăŞăŞăăˇă§ăł
//TRANSLITďźĺ¤ćăăďźďź
ăŞăă¨ăŞăčąćăčŞăă ăăăăŞăăŁăăăŞăă¨ăŞăčŚăçŽäźźăăă¤ăŤĺ¤ăă¨ăăď˝âŞă
ăżăăăŞćăă ăŁăă
ĺ ăżăŤăâ â(1)ăâ ¤âďźśăŤĺ¤ăăŚăăăŚăă
ăŞăă¨ăŞăčŚăçŽäźźăŚăăď˝
ăŞăŽă§ă
var iconv = new Iconv('UTF-8', 'ISO-2022-JP//TRANSLIT//IGNORE');
ă§č§Łćąşă