| Index: webkit/support/platform_support_mac.mm
|
| diff --git a/webkit/support/platform_support_mac.mm b/webkit/support/platform_support_mac.mm
|
| index b65ad50ae82b55f030f391151420fb5a9d3e9b48..db62c2d9f9f6360fa99de182d473a3196690ce5e 100644
|
| --- a/webkit/support/platform_support_mac.mm
|
| +++ b/webkit/support/platform_support_mac.mm
|
| @@ -14,6 +14,7 @@
|
| #include "base/mac/mac_util.h"
|
| #include "base/path_service.h"
|
| #include "base/string16.h"
|
| +#include "base/utf_string_conversions.h"
|
| #include "grit/webkit_resources.h"
|
| #include "third_party/WebKit/Source/WebKit/mac/WebCoreSupport/WebSystemInterface.h"
|
| #include "ui/base/resource/data_pack.h"
|
| @@ -162,8 +163,23 @@ string16 GetLocalizedString(int message_id) {
|
| if (!g_resource_data_pack->GetStringPiece(message_id, &res)) {
|
| LOG(FATAL) << "failed to load webkit string with id " << message_id;
|
| }
|
| - return string16(reinterpret_cast<const char16*>(res.data()),
|
| - res.length() / 2);
|
| +
|
| + // Data packs hold strings as either UTF8 or UTF16.
|
| + string16 msg;
|
| + switch (g_resource_data_pack->GetTextEncodingType()) {
|
| + case ui::DataPack::UTF8:
|
| + msg = UTF8ToUTF16(res);
|
| + break;
|
| + case ui::DataPack::UTF16:
|
| + msg = string16(reinterpret_cast<const char16*>(res.data()),
|
| + res.length() / 2);
|
| + break;
|
| + case ui::DataPack::BINARY:
|
| + default:
|
| + break;
|
| + }
|
| +
|
| + return msg;
|
| }
|
|
|
| // Helper method for getting the path to the test shell resources directory.
|
|
|