G
G
Grigory Dikiy2015-10-09 08:51:22
Programming
Grigory Dikiy, 2015-10-09 08:51:22

How to define Russian character in string?

Good day! I'm doing term paper for uni. Course topic "Code editor with SDL 2 syntax highlighting". I store the character in the class, since at the input it is possible to determine the Russian character due to the size. But what to do when reading a file? How can I determine that this is a Russian character if I receive a string of type string?
Example:
"testosteron"
How can you determine that 4 characters are Russian, because string stores 1 byte. wstring doesn't work properly on linux for some reason. There is an idea to determine by character code to distinguish Unicode. What can experienced developers advise?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
lyeskin, 2015-10-09
@lyeskin

Any string is an array of char. Those. if you are getting a single character string, then you can pull out the char via string[0].

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question