æ¦è¦ javascriptã®æååã¯UTF-16㧠String#charCodeAt(i) ã§åå¾åºæ¥ãæ°å¤ã¯2byte(0x0000ãã0xffff)ã«ãªãã escape("ã") 㯠UTF-16ããã®ã¾ã¾ã¨ã¹ã±ã¼ããã "%u3042" ã«ãªãã encodeURI("ã"),encodeURIComponent("ã") ãªã©ã§ã¯UTF-8ã«å¤æãã㦠"%E3%81%82" ã«ãªãã var str = "æååãUTF-8ã«"; var utf8str = unescape(encodeURIComponent(str)); var utf16str = decodeURIComponent(escape(utf8str)); if (str == utf16str) {alert(true);} //=> true ã¨ãããã¨ã§ UTF-16<=>UTF-8 ã®å¤æã¯åºæ¥
{{#tags}}- {{label}}
{{/tags}}