(JavaScript) 문자열의 바이트 검색
/** * 한글자 당 byte 구하기 * @param {string} charValue 문자열 * @returns {number} 바이트 */ export const charByteSize = (charValue) => { if (charValue == null || charValue.length == 0) { return 0 } let charCode = charValue.charCodeAt(0) if (charCode <= 0x00007f) { return 1 } else if (charCode <= 0x0007ff) { return 2 … Read more