| 1037 | } |
| 1038 | |
| 1039 | uint32_t unicode_tolower(uint32_t cpt) { |
| 1040 | // binary search |
| 1041 | auto it = std::lower_bound(unicode_map_lowercase.begin(), unicode_map_lowercase.end(), cpt, |
| 1042 | [](const std::pair<uint32_t, uint32_t> & pair, uint32_t value) { |
| 1043 | return pair.first < value; |
| 1044 | }); |
| 1045 | if (it != unicode_map_lowercase.end() && it->first == cpt) { |
| 1046 | return it->second; |
| 1047 | } |
| 1048 | return cpt; // Return the original code point if no lowercase mapping is found |
| 1049 | } |
| 1050 | |
| 1051 | bool unicode_cpt_is_han(uint32_t cpt) { |
| 1052 | // Han character ranges (Chinese/CJK characters) |
no test coverage detected