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

Unified Diff: pylib/gyp/mac_tool.py

Issue 23710010: ninja&make/mac: Convert .strings files to UTF-16LE, not just UTF-16. (Closed) Base URL: http://gyp.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 4 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 | « no previous file | test/mac/gyptest-app.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pylib/gyp/mac_tool.py
===================================================================
--- pylib/gyp/mac_tool.py (revision 1702)
+++ pylib/gyp/mac_tool.py (working copy)
@@ -87,16 +87,14 @@
# semicolon in dictionary.
# on invalid files. Do the same kind of validation.
import CoreFoundation
- s = open(source).read()
+ s = open(source, 'rb').read()
d = CoreFoundation.CFDataCreate(None, s, len(s))
_, error = CoreFoundation.CFPropertyListCreateFromXMLData(None, d, 0, None)
if error:
return
- fp = open(dest, 'w')
- args = ['/usr/bin/iconv', '--from-code', input_code, '--to-code',
- 'UTF-16', source]
- subprocess.call(args, stdout=fp)
+ fp = open(dest, 'wb')
+ fp.write(s.decode(input_code).encode('UTF-16'))
fp.close()
def _DetectInputEncoding(self, file_name):
« no previous file with comments | « no previous file | test/mac/gyptest-app.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698