Skip to content

Instantly share code, notes, and snippets.

View bgauthier's full-sized avatar

Benoit Gauthier bgauthier

View GitHub Profile
@kongchen
kongchen / gist:941a652882d89bb96f87
Created March 18, 2015 06:09
utf8 utf16 in javascript
/**
* Convert a UTF16 string to UTF8.
* @param {String} input
* @returns {String}
*/
utf16To8: function (input) {
var _unescape = function(s) {
function d(x, n) {
return String.fromCharCode(parseInt(n, 16));
}