From 233bc0b84aef261a67a364ff3a8e91077fd70fd6 Mon Sep 17 00:00:00 2001 From: Dirk Dougherty Date: Tue, 7 Jul 2009 17:43:27 -0700 Subject: [PATCH] AI 150370: Add localized content infrastructure in droiddoc templates, javascript, and css. DocFile.java - instead of FileReader, use InputStreamReader with UTF-8 encoding. ClearPage.java - add UTF-8 output encoding to FileOutputStreamWriter. Note: this change also up-integrates gerrit 2146 (smain). BUG=1910893 Automated import of CL 150370 --- tools/droiddoc/src/ClearPage.java | 2 +- tools/droiddoc/src/DocFile.java | 3 +- tools/droiddoc/templates-sdk/customization.cs | 49 +++++++++++-------- tools/droiddoc/templates-sdk/header_tabs.cs | 34 ++++++++++--- .../assets/android-developer-core.css | 10 +++- .../assets/android-developer-docs.css | 8 ++- .../assets/android-developer-docs.js | 47 +++++++++--------- 7 files changed, 99 insertions(+), 54 deletions(-) diff --git a/tools/droiddoc/src/ClearPage.java b/tools/droiddoc/src/ClearPage.java index 2a8fcede8d..184c8b8581 100644 --- a/tools/droiddoc/src/ClearPage.java +++ b/tools/droiddoc/src/ClearPage.java @@ -126,7 +126,7 @@ public class ClearPage OutputStreamWriter stream = null; try { stream = new OutputStreamWriter( - new FileOutputStream(file)); + new FileOutputStream(file), "UTF-8"); String rendered = cs.render(); stream.write(rendered, 0, rendered.length()); } diff --git a/tools/droiddoc/src/DocFile.java b/tools/droiddoc/src/DocFile.java index b71c0816eb..0c3d112a21 100644 --- a/tools/droiddoc/src/DocFile.java +++ b/tools/droiddoc/src/DocFile.java @@ -33,7 +33,8 @@ public class DocFile try { File f = new File(filename); int length = (int)f.length(); - FileReader reader = new FileReader(f); + FileInputStream is = new FileInputStream(f); + InputStreamReader reader = new InputStreamReader(is, "UTF-8"); char[] buf = new char[length]; int index = 0; int amt; diff --git a/tools/droiddoc/templates-sdk/customization.cs b/tools/droiddoc/templates-sdk/customization.cs index 9ec1f44b54..ba0e0f6278 100644 --- a/tools/droiddoc/templates-sdk/customization.cs +++ b/tools/droiddoc/templates-sdk/customization.cs @@ -11,12 +11,12 @@ def:default_search_box() ?>