Wulin.com의 기사 소개 (www.vevb.com) : HTML의 일반적으로 사용되는 인코딩 변환.
이 코드 스 니펫은 웹 교육 웹 사이트에서 제공합니다. var encoding = (function () {function toascii (str) {return this.tonormal (str) .replace (/[^/u0000-/u00ff]/g, function () {return Escape (인수 [0]). 대체 (/(? :%u) ([0-9a-f] {4})/gi,/$ 1;); this.tonormal (str) .replace (/[^/u0000-/u00ff]/g, function () {return Escape (/(? :%u) ([0-9a-f] {4})/gi, // u $ 1)} {str) {return str.replace (/(? :) ([0-9a-f] {4}); | (? : // u) ([0-9a-f] {4})/gi, function () {%u + (인수 [1] || arguments [2])); this.ormal (str) .replace (/[^/u0000-/u00ff]/g, function () {return Escape (인수 [0]). 대체 (/(? :%u) ([0-9a-f] {4})/gi, // $ 1)} {toascii, tounicode, tounicode : tOnormal. tocss};); console.log (encoding.toascii (安体 安体)); console.log (encoding.tounicode (安体 安体)); console.log (encoding.tonormal (安体 安体)); console.log (encoding.tounicode (安体 安体)); console.log (encoding.tounicode (安体 安体)); console.log (encoding.tonormal (安体 安体)); console.log (encoding.tounicode (安体 安体)); Console.log (encoding.tocss ( 'Arial, Helvetica, Song Font, Sans-Serif'));