Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • I think this is effectively the only way to do it, but it suffers from several problems, starting with the fact that you used prior knowledge to decide about the range of legal codepoints. In theory at least, if you're using a Unicode charmap, the character classes are independent of the script (according to Unicode standard, not C locales), but the Unicode "general categories" are not the same as C character classes either. BTW, glibc's i18n ctypes include two more character classes: combining and combining_level3 (viz. iswctype(i, wctype("combining"))) Commented May 8, 2014 at 19:46
  • @rici, see edit (and also of the question). Commented Oct 30, 2016 at 8:53