[原创]Delphi中ScriptControl的高级应用(二)[5]

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 juwuyi 的 blog

    return out;

}

 

 

function utf16to8(str) {

    var out, i, len, c;

 

 

    out = "";

    len = str.length;

    for(i = 0; i < len; i++) {

    c = str.charcodeat(i);

    if ((c >= 0x0001) && (c <= 0x007f)) {

        out += str.charat(i);

    } else if (c > 0x07ff) {

        out += string.fromcharcode(0xe0 | ((c >> 12) & 0x0f));

        out += string.fromcharcode(0x80 | ((c >>  6) & 0x3f));

        out += string.fromcharcode(0x80 | ((c >>  0) & 0x3f));

    } else {

        out += string.fromcharcode(0xc0 | ((c >>  6) & 0x1f));

本文关键:[原创]Delphi中ScriptControl的高级应用(二)
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top