gpt4 book ai didi

android - 我如何在我的 android textview 中显示 html 特殊字符

转载 作者:行者123 更新时间:2023-11-28 00:05:07 25 4
gpt4 key购买 nike

实际上我正在从 json web 服务中检索文本,它是包含标签和所有这些的 HTML 文本,我正在使用 Html.fromHtml 执行,但问题是特殊字符显示为带有问号的菱形,我不是能够以正确的形式显示。下面是我遇到问题的代码

  Description=Description.replaceAll("\\<.*?>","");
Description=Description.replaceAll("\\&ldquo;", "");
Description=Description.replaceAll("\\&rdquo;", "");
// Description=Description.replaceAll("&diams;", "");
//Description=Description.replace("&ldquo;", "");
details.setText(Html.fromHtml(Description).toString());

描述是我存储 html 文本的字符串变量,我用谷歌搜索了很多但没有得到任何东西。希望我能从这里得到一些东西提前致谢

最佳答案

在我的 WebView 中,我做了类似的事情。

productInfoWebview.loadData(value, "text/html; charset=UTF-8", null);

关于android - 我如何在我的 android textview 中显示 html 特殊字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18889414/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com