Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1102)

Unified Diff: third_party/WebKit/Source/web/WebPageSerializerImpl.cpp

Issue 1407663004: Tweaking WebPageSerializerImpl to emit a BOM for UTF16/32. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Using TextEncoding::isNonByteBasedEncoding instead. Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/web/WebPageSerializerImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebPageSerializerImpl.cpp b/third_party/WebKit/Source/web/WebPageSerializerImpl.cpp
index 694c823537fd26515f275bd1652c7d9b25ae848e..5a5d293601413f3bf543a906abb61ee7603587a6 100644
--- a/third_party/WebKit/Source/web/WebPageSerializerImpl.cpp
+++ b/third_party/WebKit/Source/web/WebPageSerializerImpl.cpp
@@ -453,6 +453,10 @@ bool WebPageSerializerImpl::serialize()
didSerialization = true;
const WTF::TextEncoding& textEncoding = document->encoding().isValid() ? document->encoding() : UTF8Encoding();
+ if (textEncoding.isNonByteBasedEncoding()) {
+ const UChar bomCharacter = 0xFEFF;
jsbell 2015/12/08 01:19:07 nit: maybe call this `byteOrderMark` as it's not t
Łukasz Anforowicz 2015/12/09 00:50:59 Done.
+ m_dataBuffer.append(bomCharacter);
+ }
SerializeDomParam param(url, textEncoding, document, m_localDirectoryName);

Powered by Google App Engine
This is Rietveld 408576698