ruiu added a comment.

So the best practice is, when you get a UTF-16 string from an Windows API, you 
should convert it to UTF-8 as soon as you can so that you can always process 
strings as UTF-8. Likewise, you should always keep all string in UTF-8 in 
memory and convert them to UTF-16 just before passing them to an Windows API if 
necessary. If you find yourself writing UTF-8 ↔ UTF-16 conversion code too 
frequently, that's like a signal that you are not doing text processing in 
UTF-8. Basically you need to do coding conversion up to only once for each new 
string.


https://reviews.llvm.org/D47578



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to