3 ms·
Not tested is https://www.npmjs.com/package/utf-8-validate https://www.npmjs.com/package/utf-8-validate (1,624,873 weekly downloads) - which I use.
by gcau 3y ago
Not tested is https://www.npmjs.com/package/utf-8-validate https://www.npmjs.com/package/utf-8-validate (1,624,873 weekly downloads) - which I use.
- striking 3y agoFrom https://github.com/websockets/utf-8-validate/tree/master/deps/is_utf8#real-word-usage https://github.com/websockets/utf-8-validate/tree/master/dep... > This C++ library is part of the JavaScript package utf-8-validate. The utf-8-validate package is routinely downloaded more than a million times per week. > If you are using Node JS (19.4.0 or better), you already have access to this function as buffer.isUtf8(input). And at https://github.com/websockets/utf-8-validate/tree/master/deps/is_utf8#reference https://github.com/websockets/utf-8-validate/tree/master/dep... > # Reference > John Keiser, Daniel Lemire, [Validating UTF-8 In Less Than One Instruction Per Byte](https://arxiv.org/abs/2010.03090 https://arxiv.org/abs/2010.03090), Software: Practice & Experience 51 (5), 2021