JAVASCRIPT

웹 페이지 meta 태그 한글 깨짐 외계어 해결

Neda 2023. 3. 17. 19:39

웹 페이지 meta 태그 한글 깨짐 외계어 해결

 

const text = "한글";
const encoder = new TextEncoder();
const decoder = new TextDecoder("windows-1252");

const encodedText = encoder.encode(text);
const output = decoder.decode(encodedText);
console.log(output); //한글