Skip to content

Instantly share code, notes, and snippets.

@ryanseys ryanseys/utf8.js
Created Apr 29, 2015

What would you like to do?
var range = Array.apply(null, Array(1000)).map(function (_, i) {return i;});
var str = '';
for (i in range) {
str += String.fromCharCode(i);
new Buffer(str).toString('utf8') == str
// returns true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.