mardi 18 février 2020

How to holding a character more than 1 byte? [closed]

I have a file Json like that

{"X": 0, "p": 1, "e": 2, "r": 3, "i": 4, "à": 5, "L": 6, "1": 7, "D": 8, "u": 9, "l": 10, "ỏ": 11}

and I have a string a = "Tỏa". How can I map "ỏ" with 11 because I cannot get the character "ỏ" with

int find = char_dict[std::string(1, a[1])];
  • char_dict is file JSON.

I have searched on the internet that String not suitable for holding a character larger than 1 byte. Can you help me to solve that problem? I will very much appreciate. Thank in advance.

Aucun commentaire:

Enregistrer un commentaire