How to make function that convert from UTF8 Cyrillic to UTF8 Latin characters? I know that I should make character table, but my main problem is how to represent string (in C ,Linux OS)? As char* or int* ( due to size of UTF8 )?
void convert(unsigned char* str) {
if(str[0] == 'A' ) str[0] = 0xd090; // Cyrillic A
...
}
You can’t replace a
charwith anint(orshort), as it won’t fit in achar. Either read the latin characters into awchar_tarray, or use a separate output array for the Cyrillic characters.