{"library":"utf8","type":"library","category":null,"description":"The `utf8.js` package, currently at its stable version 3.0.0 (last updated in late 2017), provides a comprehensively tested and robust JavaScript implementation for encoding and decoding UTF-8 strings. It distinguishes itself by strictly adhering to the Encoding Standard, ensuring precise handling of all scalar Unicode code point values. A core aspect of its design is strict error handling: the library explicitly throws an `Error` when attempting to encode non-scalar values (such as lone surrogates) or when encountering malformed UTF-8 data during decoding. This approach prioritizes data integrity over silent error correction. For developers requiring the ability to encode or decode non-scalar values, the related `WTF-8` library is recommended. Given its foundational utility and mature status, the project is considered to be in maintenance mode, receiving updates primarily for critical issues rather than frequent feature additions.","language":"javascript","status":"maintenance","version":"3.0.0","tags":["javascript","charset","encoding","unicode","utf8"],"last_verified":"Wed May 27","install":[{"cmd":"npm install utf8","imports":["const utf8 = require('utf8');","<!-- In browser -->\n<script src=\"utf8.js\"></script>\n<script>\n  const encoded = utf8.encode('Hello');\n</script>","const utf8 = require('utf8');\nconst encodedString = utf8.encode('Hello, world! 😊');"]},{"cmd":"yarn add utf8","imports":[]},{"cmd":"pnpm add utf8","imports":[]}],"homepage":"https://mths.be/utf8js","github":"https://github.com/mathiasbynens/utf8.js","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/utf8","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":{"summary":{"python_range":"18–22","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"url":"https://checklist.day/v1/registry/utf8/compatibility"}}