How is it right to count the length of the line containing the kirillian?



  • std::string str1 = "Test";
    std::string str2 = "тест";
    

    I noticed that

    str1.size() = 4str2.size() = 8

    How can you read that right?



  • Kirillica has two bays for each symbol, i.e., used by Yunikod. Latina and other symbols are on one side of the sign, i.e. code ASCII.

    Maybe you need a length.

    Look. https://ravesli.com/urok-202-dlina-i-yomkost-std-string/


Log in to reply
 

Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2