文本视图不处理希伯来语 +同一字符串中的罗马字符

发布于 2024-12-19 18:12:56 字数 489 浏览 3 评论 0原文

当使用文本视图显示我的值 XML 中的字符串时,它会以一种奇怪的方式解析它们,这与我所看到的标准不同。它似乎将我的字符串分成希伯来语和罗马/标点符号的块。每个块都得到正确处理(RTL/LTR),但整体块是从左到右而不是从右到左解析的。

示例:(箭头表示 LTR/RTL)

我的 XML 字符串(应如何显示): [希伯来语 (C) <<<<] [英语单词 (B)>>>] [希伯来语 (A) <<<<<]

在 android 上的显示方式: [希伯来语 (A) <<<<] [英语单词 (B)>>] [希伯来语 (C) <<<<<]

任何想法将不胜感激。 :)

编辑:事实证明,当我在 eclipse 中打开 XML 时,它以相同的不正确方式显示它(第二种情况),但大多数文本编辑器都能正确显示它(第一种情况)

When using a textview to display a string from my values XML it parses them in an odd way from what I've seen to be my standard. It seems to seperate my string into chunks of hebrew and roman/punctuation. Each chunk is handled properly (RTL/LTR) but the chunks overall are parsed left to right rather than right to left.

Example: (arrows denote LTR/RTL)

My XML string (how it should be displayed):
[hebrew (C) <<<<] [english word (B)>>>>] [hebrew (A) <<<<]

How it is displayed on android:
[hebrew (A) <<<<] [english word (B)>>>>] [hebrew (C) <<<<]

Any thoughts would be greatly appreciated. :)

Edit: Turns out when I open my XML in eclipse it displays it in the same incorrect way (second case) but most text editors display it correctly (first case)

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

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

发布评论

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

评论(1

许久 2024-12-26 18:12:56

Android 4.0 提供了更好的 BiDi 文本支持。使用模拟器尝试一下,看看是否可以解决您的问题。

Android 4.0 offers much better support of BiDi text. Give it a try with the emulator and see if it fixes your problem.

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