Chromium Code Reviews| Index: Source/wtf/text/TextCodecUTF8.cpp |
| diff --git a/Source/wtf/text/TextCodecUTF8.cpp b/Source/wtf/text/TextCodecUTF8.cpp |
| index ce595b34619709488d0e20aa31b955afaeeb08f3..f26f3031c9620dfdbacef299834cab27e0dd7ab5 100644 |
| --- a/Source/wtf/text/TextCodecUTF8.cpp |
| +++ b/Source/wtf/text/TextCodecUTF8.cpp |
| @@ -436,6 +436,8 @@ CString TextCodecUTF8::encodeCommon(const CharType* characters, size_t length) |
| while (i < length) { |
| UChar32 character; |
| U16_NEXT(characters, i, length, character); |
| + if (0xD800 <= character && character <= 0xDFFF) |
| + character = 0xFFFD; |
|
jungshik at Google
2013/08/30 00:39:27
For a future code archaeologist, could you add a c
jsbell
2013/08/30 00:43:56
Will do. I'll also use WTF::Unicode::replacementCh
|
| U8_APPEND_UNSAFE(bytes.data(), bytesWritten, character); |
| } |