在Android中的WebView Dipaly波斯语文本(手机不支持波斯语) [英] Dipaly farsi text in android webview (for phones not supporting farsi)

查看:278
本文介绍了在Android中的WebView Dipaly波斯语文本(手机不支持波斯语)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在波斯语字母连接在一起,形成编写脚本。然而,当我保存使用UTF-8或Windows的1256encdoings HTML页面,并尝试使用web视图Android中显示它们,字母分开,并在左到右的方向(而不是RTL)diplayed。 我应该注意到,这种情况是不会发生在手机支持波斯语。

In farsi letters are attach together to form writing scripts. However when I save HTML pages using "UTF-8" or "Windows-1256" encdoings, and try to display them using webview in android, letters are diplayed seperately and in left-to-right direction (instead of RTL). I should notice that this case is not happening in phones supporting farsi.

正确的形式应该是这样的(快照从手机支持波斯语):
在手机没有supporing波斯语
不良形成文本发生(波斯语):

Correct form should be like this (snapshot from phone supporting farsi):

Bad-formed text happens in phones not supporing farsi (Persian):

应该注意我用波斯字体在这两种情况下。 我也看到了一些解决方案,在ja​​va中普通字符串其中的一个在这个改变性格 问题

It should be noticed i've used persian font in both cases. I also see some solutions for normal Strings in java which changes character on by one in this question

我的提问:我可以解决此问题的情况下(或者它应该是通过电话供应商修复)?如果可能的话有什么解决办法?

My question: Can i fix this cases (or it should be fix by phone vendors)? if possible what is solution?

推荐答案

我打这个错误了很多,当我在做键盘。的问题是,在机器人的构建在canvas.drawText功能不支持的RTL语言。有一个补丁,但它不是Android的默认构建的一部分。因此,只有型号走出去是用它往往有它在世界的那些部分。不幸的是我没有什么别的方法来测试它是否有补丁。如果没有,有没有办法解决它。你可以尝试扭转了文本,但你会打破它确实有贴片设备。

I hit this bug a lot when I was doing keyboards. The problem is that the build in canvas.drawText function in Android didn't support RTL languages. There was a patch for it, but it wasn't part of the default build of Android. So only models going out to those parts of the world that used it tended to have it. Unfortunately I know of no way to test whether it has the patch. And if it doesn't, there's no way to fix it. You could try reversing the text, but then you'd break devices which did have the patch.

说来话长短期有没有办法解决它。不过,我想如果谷歌没有拿起补丁主线现在感到震惊(它的存在早在2.2天),所以手机的不断萎缩影响。

Long story short- there is no way to fix it. However, I'd be shocked if Google hasn't picked up the patch in mainline by now (it existed back in the 2.2 days), so its a shrinking number of phones effected.

这篇关于在Android中的WebView Dipaly波斯语文本(手机不支持波斯语)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆