Commit 5bf001b8 authored by kalman@chromium.org's avatar kalman@chromium.org

Fix unicode rendering of IDL files in the extension/apps developer server.


Review URL: https://chromiumcodereview.appspot.com/12230015

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@182346 0039d316-1c4b-4281-b951-d872f2087c98
parent 79a1be56
......@@ -15,9 +15,7 @@ class StatInfo(object):
self.version = version
self.child_versions = child_versions
def _ProcessFileData(data, path):
if os.path.splitext(path)[-1] not in ['.js', '.html', '.json']:
return data
def _ToUnicode(data):
try:
return unicode(data, 'utf-8')
except:
......
......@@ -24,7 +24,7 @@ class LocalFileSystem(file_system.FileSystem):
contents = f.read()
if binary:
return contents
return file_system._ProcessFileData(contents, filename)
return file_system._ToUnicode(contents)
except IOError:
raise file_system.FileNotFoundError(filename)
......
......@@ -32,7 +32,7 @@ class _AsyncFetchFuture(object):
elif path.endswith('/'):
self._value[path] = self._ListDir(result.content)
elif not self._binary:
self._value[path] = file_system._ProcessFileData(result.content, path)
self._value[path] = file_system._ToUnicode(result.content)
else:
self._value[path] = result.content
if self._error is not None:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment