Safari 處理 Ajax responseText 的 Unicode (中文)問題

From : http://kawa.at.webry.info/200511/article_9.html

1
2
3
4
5
6
7
8
9
function processunicode(text) {
    if (navigator.appVersion.indexOf(”KHTML”) > -1) {
        var esc = escape(text);
        if (esc.indexOf(%u”) < 0 && esc.indexOf("%") > -1) {
            text = decodeURIComponent(esc);
        }
    }
    return text;
}

Leave a Reply

Your email address will not be published. Required fields are marked *

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.