summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2015-01-26 19:51:00 +0000
committerReid Kleckner <reid@kleckner.net>2015-01-26 19:51:00 +0000
commit91ccead42a3f84760f2d9794bf8d78c879e9cbb5 (patch)
tree55ae68462caa734da3257fbc427c7d850496ecbb /include
parent7936ef08bd1c3f6a33869382c8eb950c8508da01 (diff)
Add a UTF8 to UTF16 conversion wrapper for use in the pdb dumper
This can also be used instead of the WindowsSupport.h ConvertUTF8ToUTF16 helpers, but that will require massaging some character types. The Windows support routines want wchar_t output, but wchar_t is often 32 bits on non-Windows OSs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227122 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Support/ConvertUTF.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/llvm/Support/ConvertUTF.h b/include/llvm/Support/ConvertUTF.h
index a184d0df213..38952ec99e6 100644
--- a/include/llvm/Support/ConvertUTF.h
+++ b/include/llvm/Support/ConvertUTF.h
@@ -251,6 +251,14 @@ bool hasUTF16ByteOrderMark(ArrayRef<char> SrcBytes);
*/
bool convertUTF16ToUTF8String(ArrayRef<char> SrcBytes, std::string &Out);
+/**
+ * Converts a UTF-8 string into a UTF-16 string with native endianness.
+ *
+ * \returns true on success
+ */
+bool convertUTF8ToUTF16String(StringRef SrcUTF8,
+ SmallVectorImpl<UTF16> &DstUTF16);
+
} /* end namespace llvm */
#endif