262 iconv-lite

262 iconv-lite

用途

JS 字符串编码转换

Pure JS character encoding conversion No need for native code compilation. Quick to install, works on Windows, Web, and in sandboxed environments.

Used in popular projects like Express.js (body_parser), Grunt, Nodemailer, Yeoman and others. Faster than node-iconv (see below for performance comparison).

Intuitive encode/decode API, including Streaming support.

In-browser usage via browserify or webpack (~180kb gzip compressed with Buffer shim included). Typescript type definition file included.

React Native is supported (need to install stream module to enable Streaming API).

可靠性

2000星星,下载 2000万

主要是 nodeJS 使用

官网链接

https://www.npmjs.com/package/iconv-lite

https://github.com/ashtuchkin/iconv-lite

基本使用

var iconv = require('iconv-lite');

// Convert from an encoded buffer to a js string.
str = iconv.decode(Buffer.from([0x68, 0x65, 0x6c, 0x6c, 0x6f]), 'win1251');

// Convert from a js string to an encoded buffer.
buf = iconv.encode("Sample input string", 'win1251');

// Check if encoding is supported
iconv.encodingExists("us-ascii")

其他

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值