CNode

【经验之谈】Use Buffers when decoding

Yyaochun发布于12 年前最后回复12 年前0 回复3773 浏览0 收藏

最近review别人写的代码,发现:

iconv-lite的使用上还是有点小问题:

1、Buffer里面:

'binary' - A way of encoding raw binary data into strings by using only the first 8 bits of each character. This encoding method is deprecated and should be avoided in favor of Buffer objects where possible. This encoding will be removed in future versions of Node.

2、关于 iconv.decode的decode

Keep original Buffer-s and provide them to iconv.decode. Use Buffer.concat() if needed.

In general, keep in mind that all javascript strings are already decoded and should not be decoded again.

有兴趣的人在使用iconv-lite的decode的时候注意一下

查看回复

回复 (0)

暂无回复,成为第一个参与讨论的人。
参与回复
登录后即可参与回复。登录