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

Unified Diff: chrome/common/extensions/docs/server2/subversion_file_system.py

Issue 10804036: Extensions Docs Server: Internationalized samples (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: encodings Created 8 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
Index: chrome/common/extensions/docs/server2/subversion_file_system.py
diff --git a/chrome/common/extensions/docs/server2/subversion_file_system.py b/chrome/common/extensions/docs/server2/subversion_file_system.py
index e9af0703aaa192084b0bdbb5b3c220d7f1eb6e80..bb131229b54bfb4d77914f4da198760aab872b65 100644
--- a/chrome/common/extensions/docs/server2/subversion_file_system.py
+++ b/chrome/common/extensions/docs/server2/subversion_file_system.py
@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import os
import re
import xml.dom.minidom as xml
@@ -45,7 +46,13 @@ class _AsyncFetchFuture(object):
elif path.endswith('/'):
self._value[path] = self._ListDir(result.content)
else:
- self._value[path] = result.content
+ if os.path.splitext(path)[-1] in ['.js', '.html', '.json']:
not at google - send to devlin 2012/07/25 01:44:14 This is the same code as in LocalFileSystem. Pull
cduvall 2012/07/25 18:21:34 Done.
+ try:
+ self._value[path] = unicode(result.content, 'utf-8')
+ except:
+ self._value[path] = unicode(result.content, 'latin-1')
+ else:
+ self._value[path] = result.content
if self._error is not None:
raise self._error
return self._value

Powered by Google App Engine
This is Rietveld 408576698