Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
开发者_JS百科 Improve this questionHow to do processing on hindi text using c++ in linux any suggestions. I want to read a hindi text from file encoded in UTF-8 and process it that is to find a specific word from that . How can we do it??
The design of utf8 means that you don't have to take any special encoding specific steps. The C++ standard library functions that are based on char
are all 8 bit clean, so they'll all work with utf-8 (except for esoteric environments where char
isn't 8 bits).
std::string word = /*the word you are looking for, encoded in utf8*/;
std::string fileContents = /*the file contents*/;
std::string::iterator location = fileContents.find(word);
精彩评论