summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDmitri Gribenko <gribozavr@gmail.com>2014-06-16 11:09:46 +0000
committerDmitri Gribenko <gribozavr@gmail.com>2014-06-16 11:09:46 +0000
commit9becc6c2afc7d62fd855912eacd11586feb4a760 (patch)
treeb2f69617f7ebbecc15b717177b8a9d34e1b66a08 /include
parentb3820b4289dd95e025c109a137964cf73457b5c1 (diff)
downloadllvm-9becc6c2afc7d62fd855912eacd11586feb4a760.tar.gz
llvm-9becc6c2afc7d62fd855912eacd11586feb4a760.tar.bz2
llvm-9becc6c2afc7d62fd855912eacd11586feb4a760.tar.xz
Support/ConvertUTF: implement U+FFFD insertion according to the recommendation
given in the Unicode spec That is, replace every maximal subpart of an ill-formed subsequence with one U+FFFD. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211015 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Support/ConvertUTF.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/include/llvm/Support/ConvertUTF.h b/include/llvm/Support/ConvertUTF.h
index 282036619c..a184d0df21 100644
--- a/include/llvm/Support/ConvertUTF.h
+++ b/include/llvm/Support/ConvertUTF.h
@@ -136,7 +136,19 @@ ConversionResult ConvertUTF8toUTF16 (
const UTF8** sourceStart, const UTF8* sourceEnd,
UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags);
-ConversionResult ConvertUTF8toUTF32 (
+/**
+ * Convert a partial UTF8 sequence to UTF32. If the sequence ends in an
+ * incomplete code unit sequence, returns \c sourceExhausted.
+ */
+ConversionResult ConvertUTF8toUTF32Partial(
+ const UTF8** sourceStart, const UTF8* sourceEnd,
+ UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags);
+
+/**
+ * Convert a partial UTF8 sequence to UTF32. If the sequence ends in an
+ * incomplete code unit sequence, returns \c sourceIllegal.
+ */
+ConversionResult ConvertUTF8toUTF32(
const UTF8** sourceStart, const UTF8* sourceEnd,
UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags);