Zar*_*rah 6 unicode encoding android special-characters webview
我试图在a中显示语音符号WebView,但到目前为止我只是得到了正方形.
例如,对于单词"撇号",应显示:
əpåstrəfi
但我在显示屏上看到的是:
□□påstr□网络
如果它会有帮助,我从SQLite数据库中获取字符串.我检索的字符串中有一些HTML标记,所以我用它:
webView.loadDataWithBaseURL("file:///android_asset/",
article, "text/html", Encoding.UTF_8.toString(), null);
Run Code Online (Sandbox Code Playgroud)
在哪里我有我的CSS文件/assets.并且article变量包含HTML标记中包含的一些文本.
我已经解决了在 TextView 中显示音标的问题。问题是默认的 android 字体没有实现 IPA 符号。我可以建议像这样使用 ccs
@font-face {
/* Regular */
font-family: "ConstructiumRegular";
src: url("http://openfontlibrary.org/content/RebeccaRGB/412/Constructium.ttf") format("truetype");
font-weight: 400;
font-style: normal;
font-variant: normal;
font-stretch: normal;
}
Run Code Online (Sandbox Code Playgroud)
就我而言,提到的 Constructium.ttf 适合。
| 归档时间: |
|
| 查看次数: |
4522 次 |
| 最近记录: |