| 172 | // Need to guarantee utf8_str has enough memory |
| 173 | |
| 174 | HOSTDEVICE inline void GetUTF8Str(const uint32_t* unicode_str, |
| 175 | char* utf8_str, |
| 176 | size_t unicode_len) { |
| 177 | char dst_char[5] = {0}; |
| 178 | for (size_t i = 0; i < unicode_len; ++i) { |
| 179 | uint32_t utf8_uint32 = UnicodeToUTF8(unicode_str[i]); |
| 180 | uint32_t utf8_char_count = UnicodeToUTF8Char(utf8_uint32, dst_char); |
| 181 | dst_char[utf8_char_count] = '\0'; |
| 182 | memcpy(utf8_str, dst_char, utf8_char_count); |
| 183 | utf8_str += utf8_char_count; |
| 184 | } |
| 185 | *utf8_str = '\0'; |
| 186 | } |
| 187 | |
| 188 | const uint8_t* GetUniFlagMap(); |
| 189 | const uint16_t* GetCharCasesMap(); |
no test coverage detected