I am using an api drawing that takes in const char * a string encoded by utf-8. Executing myStdString.cstr () does not work, api cannot draw a string.
eg:
sd::stringsomeText = "■□▢▣▤▥▦▧▨▩▪▫▬▭▮▯▰▱";
will output ????????????????
So, how do I get std :: string to act correctly?
thank
Try using std::codecvt_utf8to write a string to a string stream, and then pass the result ( stringstream::str) to the API.
std::codecvt_utf8
stringstream::str
There are so many variables that are hard to figure out where to start.
, API UTF-8 O/S. , , Unicode.
. , UTF-8 , , , . std::wstring UTF-8. 128 , .
std::wstring
Source: https://habr.com/ru/post/1772313/More articles:.Net (C #) Enum rewritten in java - javaВремя работы Mergesort BigO - algorithmAlertDialog setSingleChoice without switches - androidC - wanted to know the maximum amount of memory allocated in the program - cMaven combat plugin cannot exclude parsed libraries in military format - javarails button_to does not set the class correctly - ruby-on-railsC присвоение int - c++Linq to SQL intellisense не знает таблиц в объекте datacontext - sqlMass update of Couch DB using handlers - jsonGet only response headers - c #All Articles