[PATCH] [Support] Add a Unicode conversion wrapper from UTF16 to UTF8

Hans Wennborg hans at chromium.org
Mon Jul 15 17:18:11 PDT 2013


  Just driving by, but this looks good to me.


================
Comment at: include/llvm/Support/ConvertUTF.h:227
@@ +226,3 @@
+/**
+ * Converts a stream of raw bytes assumed to be UTF16 into a UTF8 std::string.
+ */
----------------
It would be nice to say what the return value means.

================
Comment at: lib/Support/ConvertUTFWrapper.cpp:78
@@ -74,1 +77,3 @@
 
+bool convertUTF16ToUTF8String(const char *SrcBytes, const char *SrcBytesEnd,
+                              std::string &Out) {
----------------
would ArrayRef<char> be appropriate here instead of pointers to the start and end?


http://llvm-reviews.chandlerc.com/D1138



More information about the llvm-commits mailing list