c++ - Does STL sort support UTF8? -



c++ - Does STL sort support UTF8? -

does stl sort function back upwards alphabetical sorting of names have utf-8 characters in them? names german/french language?

that exclusively depends on how store utf-8 characters , how comparer looks like. sort function agnostic of elements sorts.

but mean “… when stored in char array” , reply no since chars store individual bytes of given utf-8 character, instead of logical character. sort function sorts elements delimited iterators. sort works if iterators / elements refer aware of info contain. isn’t case array of chars encode utf-8.

the “correct” solution here parse utf-8 input array of proper (normalised) unicode code points, sort those, , translate utf-8.

c++ sorting stl utf-8

Comments

Popular posts from this blog

c# - Move local mssql database to webhosted MYSQL -

java - How to pass parameters between Request-Scoped Controllers? -

string - what is the difference between "some" == "some\0" and strcmp("some","some\0") in c++? -