Index: chrome/common/extensions/docs/server2/file_system.py |
diff --git a/chrome/common/extensions/docs/server2/file_system.py b/chrome/common/extensions/docs/server2/file_system.py |
index 34133d6f834ec460c2ca9b67fcae7ff81e433ddb..617d43ab2e4becc89d8f3ee46b78d2b1e70d2c95 100644 |
--- a/chrome/common/extensions/docs/server2/file_system.py |
+++ b/chrome/common/extensions/docs/server2/file_system.py |
@@ -2,6 +2,16 @@ |
# Use of this source code is governed by a BSD-style license that can be |
# found in the LICENSE file. |
+import os |
+ |
+def _ProcessFileData(data, path): |
+ if os.path.splitext(path)[-1] not in ['.js', '.html', '.json']: |
+ return data |
+ try: |
+ return unicode(data, 'utf-8') |
+ except: |
+ return unicode(data, 'latin-1') |
+ |
class FileSystem(object): |
"""A FileSystem interface that can read files and directories. |
""" |