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

Unified Diff: chrome_frame/simple_resource_loader.cc

Issue 7744017: Updated *.pak file format to support both UTF8 and UTF16 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Modified mac-specific parts of the code. Created 9 years, 3 months 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/tools/mac_helpers/infoplist_strings_util.mm ('k') | tools/grit/grit/format/data_pack.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/simple_resource_loader.cc
diff --git a/chrome_frame/simple_resource_loader.cc b/chrome_frame/simple_resource_loader.cc
index 2d1e80a49903df618bf62e50810deb7145e1e552..a28a62caa6c1b5678b9ea80f313194e758f81304 100644
--- a/chrome_frame/simple_resource_loader.cc
+++ b/chrome_frame/simple_resource_loader.cc
@@ -241,10 +241,14 @@ std::wstring SimpleResourceLoader::GetLocalizedResource(int message_id) {
return std::wstring();
}
- // Data pack encodes strings as UTF16.
- DCHECK_EQ(data.length() % 2, 0U);
- string16 msg(reinterpret_cast<const char16*>(data.data()),
- data.length() / 2);
+ // Data pack encodes strings as either UTF8 or UTF16.
+ string16 msg;
+ if (data_pack_->GetTextEncodingType() == ui::DataPack::UTF16) {
+ msg = string16(reinterpret_cast<const char16*>(data.data()),
+ data.length() / 2);
+ } else if (data_pack_->GetTextEncodingType() == ui::DataPack::UTF8) {
+ msg = UTF8ToUTF16(data);
+ }
return msg;
}
« no previous file with comments | « chrome/tools/mac_helpers/infoplist_strings_util.mm ('k') | tools/grit/grit/format/data_pack.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698