generation/utils.js
// U+0FFF was chosen because it's small and unassigned, as well as 32 chars before it
U+0FFF was chosen because it's small and unassigned, as well as 32 chars before it
U + 0FFF was chosen because it ' s small and unassigned as well as 32 chars before it
function arrToStr(arr) {
    var s = '';
    for (var i = 0; i < arr.length; i++)
        if (Array.isArray(arr[i])) {
            if (arr[i].length == 1)
                s += arrToStr(arr[i]);
            else if (arr[i].length > 1)
                s += String.fromCharCode(0xFFF - (arr[i].length-2)) 
                    + arrToStr(arr[i]);
        } else if (arr[i] > 0xFFFF) {
            s += String.fromCharCode(0xD800 + Math.floor((arr[i] - 0x10000) / 0x400))
               + String.fromCharCode(0xDC00 + (arr[i] - 0x10000) % 0x400);
        } else {
            s += String.fromCharCode(arr[i]);
        }    
    return s;
}
function arrToStr ( arr ) { var s = '' ; for ( var i = 0 ; i < arr . length ; i ++ ) if ( Array . isArray ( arr [ i ] ) ) { if ( arr [ i ] . length == 1 ) s += arrToStr ( arr [ i ] ) ; else if ( arr [ i ] . length > 1 ) s += String . fromCharCode ( 0xFFF - ( arr [ i ] . length - 2 ) ) + arrToStr ( arr [ i ] ) ; } else if ( arr [ i ] > 0xFFFF ) { s += String . fromCharCode ( 0xD800 + Math . floor ( ( arr [ i ] - 0x10000 ) / 0x400 ) ) + String . fromCharCode ( 0xDC00 + ( arr [ i ] - 0x10000 ) % 0x400 ) ; } else { s += String . fromCharCode ( arr [ i ] ) ; } return s ; }
U+0FFF was chosen because it's small and unassigned, as well as 32 chars before it
U + 0FFF was chosen because it ' s small and unassigned as well as 32 chars before it
// Surrogates // Basic characters.