| 139 | } |
| 140 | |
| 141 | static inline bool IsDigitCharacterUnicode(uint32_t codepoint) { |
| 142 | // Approximates Python's str.isnumeric(): |
| 143 | // returns true for Nd and No (e.g., '٣', '³'), but excludes Nl like Roman numerals |
| 144 | // ('Ⅷ') due to utf8proc limits. |
| 145 | // '¾' (vulgar fraction) is treated as a digit by utf8proc 'No' |
| 146 | return HasAnyUnicodeGeneralCategory(codepoint, UTF8PROC_CATEGORY_ND, |
| 147 | UTF8PROC_CATEGORY_NO); |
| 148 | } |
| 149 | |
| 150 | static inline bool IsNumericCharacterUnicode(uint32_t codepoint) { |
| 151 | // Formally this is not correct, but utf8proc does not allow us to query for Numerical |
no test coverage detected