ecomfe / fontmin

Minify font seamlessly
http://ecomfe.github.io/fontmin
MIT License
5.62k stars 311 forks source link

为了兼容4字节unicode字符,charCodeAt改为codePointAt #72

Closed abeet closed 4 years ago

abeet commented 5 years ago

str.split('') 会将4字节unicode字符拆成两个字符,改为Array.from(str) text.charCodeAt(0) 只会识别4字节unicode字符的前两个字节,改为text.codePointAt(0)

junmer commented 4 years ago

@abeet

TypeError: Object function Array() { [native code] } has no method 'from'

这个低版本 不支持哦,可以看下 如何兼容么?thx

junmer commented 4 years ago

https://stackoverflow.com/questions/4547609/how-do-you-get-a-string-to-a-character-array-in-javascript/34717402#34717402

找到了,我改下