使用 android 加载希伯来语 rss 时显示反数...

发布于 2024-09-08 03:19:22 字数 154 浏览 13 评论 0原文

我正在使用 eclipse android 环境加载带有 xml Dom 的希伯来语 (rtl) xml feed。

在 TextView 上显示提要时,文本可以,但数字显示相反,

例如:

如果提要 (XML) 包含 007,它将显示为 700。

I'm Loading an Hebrew (rtl) xml feed with xml Dom using eclipse android environment.

When displaying the feed on TextView text is OK but numbers Displaying inverse

for example :

if feed (XML) contain 007 it WILL displayed as 700..

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

雪化雨蝶 2024-09-15 03:19:22

我重新发布我自己的答案:

“尝试在 webkit 控件中呈现您的文本,只要 HTML 代码被适当标记,它的 RTL 支持就可以正常工作。”

希望对你也有帮助。

I'm re-posting my own answer:

"Try presenting your text in a webkit control, its RTL support works fine, as long as the HTML code is tagged appropriately."

Hope that helps you too.

能否归途做我良人 2024-09-15 03:19:22

Android 并不正式支持 RTL 语言。

看看这里: Android:RTL支持 - 从右到左的句子中嵌入数字(希伯来语)

Android doesn't officially support RTL languages.

Have a look here: Android: RTL support - digits embedded in a right to left sentence (Hebrew)

丶视觉 2024-09-15 03:19:22

我没有足够的代表来回复@Vitalyb 答案的评论,但我已经使用了这个解决方案并且效果很好。你只需要使用一个 webview,并用 html 文本加载它。 Android 开发网站上有大量可用的代码示例。

I don't have enough rep to reply to the comments on @Vitalyb's answer, but I have used this solution and it works great. You just need to use a webview, and load it with html text. There are plenty of code samples available on the Android dev sites.

倾城°AllureLove 2024-09-15 03:19:22

我的最终解决方案是:

添加 charset=utf-8

public static String BuildHtml(String _HtmlString)
{       
    StringBuilder sb = new StringBuilder();
    sb.append("<html>");
    sb.append("<meta http-equiv=\"Content-Type\" content=\"text/html;
            charset=utf-8\">");
    sb.append("<body style=\"direction:rtl;\">");
    sb.append(_HtmlString.trim());
    sb.append("</body>");
    sb.append("</html>");

    return sb.toString();
}

然后在 loadData 之前调用它。

 myWebview.loadData(BuildHtml(mytext), "text/html", "utf-8");

我很高兴听到(轻)简单的解决方案,使用 TextView 而不是 WebView。

感谢

http://www.wave-site.com/

my final solution was:

add a charset=utf-8

public static String BuildHtml(String _HtmlString)
{       
    StringBuilder sb = new StringBuilder();
    sb.append("<html>");
    sb.append("<meta http-equiv=\"Content-Type\" content=\"text/html;
            charset=utf-8\">");
    sb.append("<body style=\"direction:rtl;\">");
    sb.append(_HtmlString.trim());
    sb.append("</body>");
    sb.append("</html>");

    return sb.toString();
}

then calling it just before loadData..

 myWebview.loadData(BuildHtml(mytext), "text/html", "utf-8");

I will glad to hear about (light) simple solution then that,for using a TextView instead of WebView..

thanks

http://www.wave-site.com/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文