Skip to content

Instantly share code, notes, and snippets.

@sergeevabc
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sergeevabc/a0858fc0b022399ecd89 to your computer and use it in GitHub Desktop.
Save sergeevabc/a0858fc0b022399ecd89 to your computer and use it in GitHub Desktop.
function stringToUTF8Array(s) {
var i,
d = unescape(encodeURIComponent(s)),
b = new Uint8Array(d.length);
for (i = 0; i < d.length; i++) b[i] = d.charCodeAt(i);
return b;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment