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

Unified Diff: build/android/gyp/generate_v14_compatible_resources.py

Issue 1257833003: Make generate_v14_compatible_resources.py not break for non-ascii characters (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/gyp/generate_v14_compatible_resources.py
diff --git a/build/android/gyp/generate_v14_compatible_resources.py b/build/android/gyp/generate_v14_compatible_resources.py
index 9c8ff3b4e9d144acd7c1cf92f59e7efb51409480..a22400ddaf53f986fc50c4429cb61fedee5fd540 100755
--- a/build/android/gyp/generate_v14_compatible_resources.py
+++ b/build/android/gyp/generate_v14_compatible_resources.py
@@ -19,6 +19,7 @@ we drop the support for JB-MR1.
Please refer to http://crbug.com/235118 for the details.
"""
+import codecs
import optparse
import os
import re
@@ -96,7 +97,7 @@ def AssertNotDeprecatedAttribute(name, value, filename):
def WriteDomToFile(dom, filename):
"""Write the given dom to filename."""
build_utils.MakeDirectory(os.path.dirname(filename))
- with open(filename, 'w') as f:
+ with codecs.open(filename, 'w', 'utf-8') as f:
dom.writexml(f, '', ' ', '\n', encoding='utf-8')
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698