1.0.2 • Published 5 years ago

unisafe v1.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

Remove invalid Unicode characters out of your string and JSON with unisafe

Install

npm install --save unisafe

Usage

Remove invalid Unicode characters out of your string:

const unisafe = require('unisafe');

const goodString = unisafe('Bad unicode string.');

console.log(goodString);

Remove invalid Unicode characters out of your JSON:

const unisafe = require('unisafe');

const validJSON = unisafe(`[{ "foo": "Invalid unicode string in JSON." }]`);

const myArray = JSON.parse(validJSON);

console.log(myArray);