2utf8 中文文档教程

发布于 4年前 浏览 34 项目主页 更新于 3年前

2UTF8

将字符串文本或文本缓冲区转换为 UTF-8

NPM URL

http://npmjs.com/package/2utf8

GIT URL

https://github.com/warlock/2utf8

Example:

const toUtf8 = require('2utf8')
const request = require(request)

request('https://www.js.gl', { encoding: null }, (err, res, bodybuffer) => {
  try {
    const text = toUtf8(bodybuffer)
    console.log(text)
  } catch (error) {
    console.error(error)
  }
})

License

MIT 许可证 (MIT) 版权所有 (c) 2017 Josep Subils (js@js.gl)

特此免费授予获得本软件和相关文档文件(“软件”)副本的任何人不受限制地处理本软件的许可,包括但不限于使用、复制、修改、合并、发布、分发、再许可和/或出售软件副本的权利,以及允许获得软件的人这样做的权利,但须满足以下条件:

上述版权声明和本许可声明应包含在本软件的所有副本或重要部分中。

本软件“按原样”提供,不提供任何明示或暗示的保证,包括但不限于对适销性、特定用途的适用性和非侵权的保证。 在任何情况下,作者或版权持有人均不对任何索赔、损害或其他责任负责,无论是在合同诉讼、侵权行为还是其他方面,由软件或软件的使用或其他交易引起、由软件引起或与之相关软件。

2UTF8

Tranform string text or text buffer to UTF-8

NPM URL

http://npmjs.com/package/2utf8

GIT URL

https://github.com/warlock/2utf8

Example:

const toUtf8 = require('2utf8')
const request = require(request)

request('https://www.js.gl', { encoding: null }, (err, res, bodybuffer) => {
  try {
    const text = toUtf8(bodybuffer)
    console.log(text)
  } catch (error) {
    console.error(error)
  }
})

License

The MIT License (MIT) Copyright (c) 2017 Josep Subils (js@js.gl)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文