Index: src/unicode-inl.h |
diff --git a/src/unicode-inl.h b/src/unicode-inl.h |
index c80c67e1af68d9803bf87a918d3b572c00b27fd1..02be45768883804d8136f66bf6c5a67023b73bc8 100644 |
--- a/src/unicode-inl.h |
+++ b/src/unicode-inl.h |
@@ -95,6 +95,18 @@ uint16_t Latin1::ConvertNonLatin1ToLatin1(uint16_t c) { |
} |
+unsigned Utf8::EncodeOneByte(char* str, uint8_t c) { |
+ static const int kMask = ~(1 << 6); |
+ if (c <= kMaxOneByteChar) { |
+ str[0] = c; |
+ return 1; |
+ } |
+ str[0] = 0xC0 | (c >> 6); |
+ str[1] = 0x80 | (c & kMask); |
+ return 2; |
+} |
+ |
+ |
unsigned Utf8::Encode(char* str, uchar c, int previous) { |
static const int kMask = ~(1 << 6); |
if (c <= kMaxOneByteChar) { |