feross/native-buffer-browserify — pull request #13 by jessetane (2014-01-05 23:46:28+00:00)
Title: handle utf16 surrogate pairs

node's `Buffer` seems to handle these seamlessly but `native-buffer-browserify` fails because it attempts to convert single utf16 surrogate pair leads with `encodeURIComponent` - which can only handle full pairs.

this patch detects and accommodates for well formed surrogates, however orphaned code points are simply handed to `encodeURIComponent` which seems to throw when it's supposed to.