CJK characters are stored in the range 3400–4DBF and 3400-4DB5 (could be others, but those are what Google comes up with first).
You can use JavaScript regular expressions to check for Unicode ranges. The challenge is that Unicode uses UCS-2 internally, and EMCAScript 5 doesn't handle surrogate pairs.
Yup. It does all of the stuff I had trouble finding and figuring out by myself. I'm sure more annoying corner cases will come up later on (as they always do with alphabets and unicode), and I'll keep adding to it.
5 comments
[ 4.4 ms ] story [ 24.6 ms ] threadYou can use JavaScript regular expressions to check for Unicode ranges. The challenge is that Unicode uses UCS-2 internally, and EMCAScript 5 doesn't handle surrogate pairs.
Thankfully, there's https://mths.be/regenerate/.
See http://en.wikipedia.org/wiki/Unicode_block