jeudi 6 décembre 2018

Using Unicode (UTF-8) in C++

Currently, I have to deal with Unicode in C++ 11 (Linux environment). UTF-8 is used as default encoding. Tasks that I need:

  • Replace.
  • Regex
  • Iterate through a UTF-8 string. I don't know if using std::string and "for (character c : s)" will do what I want 'cause each character must be a unicode character. For example ế is one character, mão is a word contains 3 characters
  • Substring.
  • Concatenate substring with unicode characters or concatenate unicode characters.
  • Length.
  • Trim.
  • Read and write files.

What library should I use to achieve the best result?

Thank you very much. Looking forward to hearing from you soon.

Aucun commentaire:

Enregistrer un commentaire