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

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_converter.py

Issue 2037743002: Support converting utf-16 files when importing w3c tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Modified files to match Master/Origin (with changes) Created 4 years, 7 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
Index: third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_converter.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_converter.py b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_converter.py
index ef25fb91c9344e3a0863a1a1642d9149c8403c8c..060667d3ee4d5cd27b51a10e044673b700ac2ef0 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_converter.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_converter.py
@@ -47,7 +47,10 @@ def convert_for_webkit(new_path, filename, reference_support_info, host=Host()):
if filename.endswith('.css'):
return converter.add_webkit_prefix_to_unprefixed_properties(contents.decode('utf-8'))
else:
- converter.feed(contents.decode('utf-8'))
+ try:
+ converter.feed(contents.decode('utf-8'))
+ except UnicodeDecodeError:
+ converter.feed(contents.decode('utf-16'))
converter.close()
return converter.output()

Powered by Google App Engine
This is Rietveld 408576698