Dbrant has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/338355 )

Change subject: [Facepalm] Load CSS as Unicode, not ASCII.
......................................................................

[Facepalm] Load CSS as Unicode, not ASCII.

Our CSS contains several "#content" directives that inject additional
content into the HTML, some of which contain Unicode characters. We've
been noticing that these characters don't seem to be rendering correctly
in our WebView.

It turns out that the WebView has been loading the CSS content as ASCII,
and we need to explicitly declare our content to be UTF-8 in a "meta" tag
in the HTML. It's surprising that UTF-8 is not the default, but there
you go.

Bug: T158067
Change-Id: Ia0cd07d99ba1fb09112a883901c1d5d40a29eba7
---
M app/src/main/assets/index.html
M app/src/main/assets/preview.html
M www/index.html
M www/preview.html
4 files changed, 8 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia 
refs/changes/55/338355/1

diff --git a/app/src/main/assets/index.html b/app/src/main/assets/index.html
index fcf2f2a..922d140 100644
--- a/app/src/main/assets/index.html
+++ b/app/src/main/assets/index.html
@@ -3,6 +3,8 @@
 <head>
     <base href="" /> <!-- Set dynamically when loading each page -->
     <script src="file:///android_asset/bundle.js"></script>
+
+    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
     <link rel="stylesheet" href="file:///android_asset/styles.css"/>
 
     <meta name="viewport" content="width=device-width, user-scalable=no" />
diff --git a/app/src/main/assets/preview.html b/app/src/main/assets/preview.html
index 185cf1d..c74c8b8 100644
--- a/app/src/main/assets/preview.html
+++ b/app/src/main/assets/preview.html
@@ -3,6 +3,8 @@
 <head>
     <base href="https://wikipedia.org"; /> <!-- Force links to resolve with 
https as protocol, rather than file:// -->
     <script src="file:///android_asset/preview.js"></script>
+
+    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
     <link rel="stylesheet" href="file:///android_asset/preview.css"/>
 
     <meta name="viewport" content="width=device-width, user-scalable=no" />
diff --git a/www/index.html b/www/index.html
index fcf2f2a..922d140 100644
--- a/www/index.html
+++ b/www/index.html
@@ -3,6 +3,8 @@
 <head>
     <base href="" /> <!-- Set dynamically when loading each page -->
     <script src="file:///android_asset/bundle.js"></script>
+
+    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
     <link rel="stylesheet" href="file:///android_asset/styles.css"/>
 
     <meta name="viewport" content="width=device-width, user-scalable=no" />
diff --git a/www/preview.html b/www/preview.html
index 185cf1d..c74c8b8 100644
--- a/www/preview.html
+++ b/www/preview.html
@@ -3,6 +3,8 @@
 <head>
     <base href="https://wikipedia.org"; /> <!-- Force links to resolve with 
https as protocol, rather than file:// -->
     <script src="file:///android_asset/preview.js"></script>
+
+    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
     <link rel="stylesheet" href="file:///android_asset/preview.css"/>
 
     <meta name="viewport" content="width=device-width, user-scalable=no" />

-- 
To view, visit https://gerrit.wikimedia.org/r/338355
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia0cd07d99ba1fb09112a883901c1d5d40a29eba7
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Dbrant <dbr...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to