rem: var c; var s; var enc = ""; var i = 0;  while (i < wide.length) { c = wide.charCodeAt(i++);  if (c >= 0xDC00 && c < 0xE000) { continue; }  if (c >= 0xD800 && c < 0xDC00) { if (i >= wide.length) { continue; }  s = wide.charCodeAt(i++); if (s<0xDC00 || c>=0xDE00) { continue; }  c = ((c - 0xD800) << 10) + (s - 0xDC00) + 0x10000; }   if (c < 0x80) { enc += String.fromCharCode(c); } else if (c < 0x800) { enc += String.fromCharCode(0xC0 + (c >> 6), 0x80 + (c & 0x3F)); } else if (c < 0x10000) { enc += String.fromCharCode(0xE0 + (c >> 12), 0x80 + (c >> 6 & 0x3F), 0x80 + (c & 0x3F)); } else { enc += String.fromCharCode(0xF0 + (c >> 18), 0x80 + (c >> 12 & 0x3F), 0x80 + (c >> 6 & 0x3F), 0x80 + (c & 0x3F)); } }  return enc; 
add: var c; var s; var enc = ""; var i = 0; while (i < wide.length) { c = wide.charCodeAt(i++);  if (c >= 0xDC00 && c < 0xE000) continue; if (c >= 0xD800 && c < 0xDC00) { if (i >= wide.length) continue; s = wide.charCodeAt(i++); if (s < 0xDC00 || c >= 0xDE00) continue; c = ((c - 0xD800) << 10) + (s - 0xDC00) + 0x10000; }  if (c < 0x80) { enc += String.fromCharCode(c); } else if (c < 0x800) { enc += String.fromCharCode(0xC0 + (c >> 6), 0x80 + (c & 0x3F)); } else if (c < 0x10000) { enc += String.fromCharCode(0xE0 + (c >> 12), 0x80 + (c >> 6 & 0x3F), 0x80 + (c & 0x3F)); } else { enc += String.fromCharCode(0xF0 + (c >> 18), 0x80 + (c >> 12 & 0x3F), 0x80 + (c >> 6 & 0x3F), 0x80 + (c & 0x3F)); } 
context:     DWREngine._utf8 = function(wide) {        var c;        var s;        var enc = "";        var i = 0;        while (i < wide.length) {            c = wide.charCodeAt(i++);            // handle UTF-16 surrogates            if (c >= 0xDC00 && c < 0xE000) {                continue;            }            if (c >= 0xD800 && c < 0xDC00) {                if (i >= wide.length) {                    continue;                }                s = wide.charCodeAt(i++);                if (s<0xDC00 || c>=0xDE00) {                    continue;                }                c = ((c - 0xD800) << 10) + (s - 0xDC00) + 0x10000;            }            // output value            if (c < 0x80) {                enc += String.fromCharCode(c);            }            else if (c < 0x800) {                enc += String.fromCharCode(0xC0 + (c >> 6), 0x80 + (c & 0x3F));            }            else if (c < 0x10000) {                enc += String.fromCharCode(0xE0 + (c >> 12), 0x80 + (c >> 6 & 0x3F), 0x80 + (c & 0x3F));            }            else {                enc += String.fromCharCode(0xF0 + (c >> 18), 0x80 + (c >> 12 & 0x3F), 0x80 + (c >> 6 & 0x3F), 0x80 + (c & 0x3F));            }        }        return enc;    }
meta: 266	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/266/769a5807f342d8541951d74937d724ab38fcafe0/engine.js/buggy/java/uk/ltd/getahead/dwr/engine.js