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): ...@@ -15,9 +15,7 @@ class StatInfo(object):
self.version = version self.version = version
self.child_versions = child_versions self.child_versions = child_versions
def _ProcessFileData(data, path): def _ToUnicode(data):
if os.path.splitext(path)[-1] not in ['.js', '.html', '.json']:
return data
try: try:
return unicode(data, 'utf-8') return unicode(data, 'utf-8')
except: except:
......
...@@ -24,7 +24,7 @@ class LocalFileSystem(file_system.FileSystem): ...@@ -24,7 +24,7 @@ class LocalFileSystem(file_system.FileSystem):
contents = f.read() contents = f.read()
if binary: if binary:
return contents return contents
return file_system._ProcessFileData(contents, filename) return file_system._ToUnicode(contents)
except IOError: except IOError:
raise file_system.FileNotFoundError(filename) raise file_system.FileNotFoundError(filename)
......
...@@ -32,7 +32,7 @@ class _AsyncFetchFuture(object): ...@@ -32,7 +32,7 @@ class _AsyncFetchFuture(object):
elif path.endswith('/'): elif path.endswith('/'):
self._value[path] = self._ListDir(result.content) self._value[path] = self._ListDir(result.content)
elif not self._binary: elif not self._binary:
self._value[path] = file_system._ProcessFileData(result.content, path) self._value[path] = file_system._ToUnicode(result.content)
else: else:
self._value[path] = result.content self._value[path] = result.content
if self._error is not None: 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