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

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: Rebased after landing the test files in a separate CL. 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
« no previous file with comments | « chrome/test/data/save_page/frames-encodings.htm ('k') | third_party/WebKit/Source/wtf/text/TextEncoding.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3c933e1b6602a56648870521ec6f10c2e5881a80..b2a8a483f661c086297e79b0ebe8f030c92c04cf 100644
--- a/third_party/WebKit/Source/web/WebPageSerializerImpl.cpp
+++ b/third_party/WebKit/Source/web/WebPageSerializerImpl.cpp
@@ -443,6 +443,10 @@ bool WebPageSerializerImpl::serialize()
didSerialization = true;
const WTF::TextEncoding& textEncoding = document->encoding().isValid() ? document->encoding() : UTF8Encoding();
+ if (textEncoding.isNonByteBasedEncoding()) {
+ const UChar byteOrderMark = 0xFEFF;
+ m_dataBuffer.append(byteOrderMark);
+ }
SerializeDomParam param(url, textEncoding, document);
« no previous file with comments | « chrome/test/data/save_page/frames-encodings.htm ('k') | third_party/WebKit/Source/wtf/text/TextEncoding.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698