How 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??
+1
A:
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);
Joe Gauterin
2010-06-15 07:57:55