UNPKG

string-to-utf8

Version:

Encode JavaScript strings in UTF-8

11 lines (7 loc) 191 B
# toUtf8 Convert JavaScript strings to UTF-8 encode `Uint8Array`s. Zero dependencies. Written in vanilla JavaScript. ## Usage ```js const toUtf8 = require('toUtf8') toUtf8('🇨🇭') ```