switch to yet another hack to display utf-8 characters in webview,

thanks google!
This commit is contained in:
Andrew Dolgov 2011-11-27 10:40:59 +03:00
parent 09f01cbf1e
commit a523002b83
2 changed files with 9 additions and 7 deletions

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.fox.ttrss" package="org.fox.ttrss"
android:versionCode="9" android:versionCode="10"
android:versionName="0.1.8"> android:versionName="0.1.9">
<uses-sdk android:minSdkVersion="8" /> <uses-sdk android:minSdkVersion="8" />
<!-- <supports-screens android:smallScreens="false" android:normalScreens="false" /> --> <!-- <supports-screens android:smallScreens="false" android:normalScreens="false" /> -->

View File

@ -56,22 +56,24 @@ public class ArticleFragment extends Fragment {
cssOverride = "body { background : black; color : #f0f0f0}\n"; cssOverride = "body { background : black; color : #f0f0f0}\n";
} }
content = URLEncoder.encode("<html>" + content =
"<html>" +
"<head>" + "<head>" +
"<meta content=\"text/html; charset=utf-8\" http-equiv=\"content-type\">" + // wtf, google? "<meta content=\"text/html; charset=utf-8\" http-equiv=\"content-type\">" +
"<style type=\"text/css\">" + "<style type=\"text/css\">" +
cssOverride + cssOverride +
"img { max-width : 90%; }" + "img { max-width : 90%; }" +
"body { text-align : justify; }" + "body { text-align : justify; }" +
"</style>" + "</style>" +
"</head>" + "</head>" +
"<body>" + m_article.content + "</body></html>", "utf-8").replace('+', ' '); "<body>" + m_article.content + "</body></html>";
} catch (UnsupportedEncodingException e) {
} catch (Exception e) {
content = getString(R.string.could_not_decode_content); content = getString(R.string.could_not_decode_content);
e.printStackTrace(); e.printStackTrace();
} }
web.loadData(content, "text/html", "utf-8"); web.loadDataWithBaseURL(null, content, "text/html", "utf-8", null);
} }
TextView dv = (TextView)view.findViewById(R.id.date); TextView dv = (TextView)view.findViewById(R.id.date);