0

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
    ...
}
1

1 Answer 1

1

You can't replace a char with an int (or short), as it won't fit in a char. Either read the latin characters into a wchar_t array, or use a separate output array for the Cyrillic characters.

Not the answer you're looking for? Browse other questions tagged or ask your own question.