Change most visited template to use 'utf-8' encoding
CR-Fixed: 806100
Change-Id: Ia36d779044c6d840413fde227c356b34c169eece
diff --git a/res/raw/most_visited.ktpl b/res/raw/most_visited.ktpl
index 9a6e1b8..75180b1 100644
--- a/res/raw/most_visited.ktpl
+++ b/res/raw/most_visited.ktpl
@@ -3,7 +3,8 @@
<html>
<head>
<title><%@ string/new_tab %></title>
-<meta name="viewport" content="width=device-width; initial-scale=1.0; user-scalable=0" />
+<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0" />
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style type="text/css">
diff --git a/src/com/android/browser/homepages/RequestHandler.java b/src/com/android/browser/homepages/RequestHandler.java
index df171b4..e084f4a 100644
--- a/src/com/android/browser/homepages/RequestHandler.java
+++ b/src/com/android/browser/homepages/RequestHandler.java
@@ -35,6 +35,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
+import java.nio.charset.Charset;
import java.text.DateFormat;
import java.text.DecimalFormat;
import java.util.Arrays;
@@ -48,6 +49,7 @@
private static final int INDEX = 1;
private static final int RESOURCE = 2;
private static final UriMatcher sUriMatcher = new UriMatcher(UriMatcher.NO_MATCH);
+ private static final Charset UTF8_CHARSET = Charset.forName("UTF-8");
Uri mUri;
Context mContext;
@@ -93,7 +95,7 @@
}
byte[] htmlEncode(String s) {
- return TextUtils.htmlEncode(s).getBytes();
+ return TextUtils.htmlEncode(s).getBytes(UTF8_CHARSET);
}
// We can reuse this for both History and Bookmarks queries because the