From 68bf60380800cbd4210f32433ec0310aa8646da2 Mon Sep 17 00:00:00 2001 From: "tc@google.com" Date: Thu, 5 Feb 2009 00:07:51 +0000 Subject: Convert webkit_glue::GetLocalizedString to return a string16 instead of a wstring. Convert the linux data pack files to pack message strings as utf16 instead of utf8. Review URL: http://codereview.chromium.org/20060 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9193 0039d316-1c4b-4281-b951-d872f2087c98 --- tools/grit/grit/node/message.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tools') diff --git a/tools/grit/grit/node/message.py b/tools/grit/grit/node/message.py index 66afa64..5ae1162 100644 --- a/tools/grit/grit/node/message.py +++ b/tools/grit/grit/node/message.py @@ -183,8 +183,10 @@ class MessageNode(base.ContentNode): id = id_map[self.GetTextualIds()[0]] message = self.ws_at_start + self.Translate(lang) + self.ws_at_end - # |message| is a python unicode string, so convert to a utf8 byte stream. - return id, message.encode('utf8') + # |message| is a python unicode string, so convert to a utf16 byte stream + # because that's the format of datapacks. We skip the first 2 bytes + # because it is the BOM. + return id, message.encode('utf16')[2:] # static method def Construct(parent, message, name, desc='', meaning='', translateable=True): -- cgit v1.1