Looking for a method for flipping bidi (Hebrew) text so it would be displayed correctly in AndEngine

我怕爱的太早我们不能终老 提交于 2019-12-08 01:20:51

问题


I've been lurking around the web for days trying to look for a code implementation (Preferably Java) for flipping Bidi text so it would be displayed correctly inside platforms that do not support Bidi text text out of the box. (Such as AndEngine).

The optimal solution would be a method that I would provide it with Hebrew text, and it would return its content flipped. I could do this by myself but it's getting complicated once it gets to mixed strings of both English and Hebrew text, as well as I think it would be quite dumb for me to implement it as probably there should be much better implementations out there already.

The closest thing I found was this Unicode algorithm -

http://www.unicode.org/reports/tr9/

http://www.unicode.org/Public/PROGRAMS/BidiReferenceJava/

Which was too complex and too big and didn't do all the job.

Also there was this Bidi class in Java

http://docs.oracle.com/javase/7/docs/api/java/text/Bidi.html

But it only provided simple methods to analyze Bidi text.

I'm pretty sure this is a common problem as unfortunately many platforms and game engines do not fully support Bidi text.

Thanks!


回答1:


Try ICU

ICU is a mature, widely used set of C/C++ & Java libraries providing Unicode and Globalization support for software applications.

ICU is widely portable and gives applications the same results on all platforms and between C/C++ & Java software.

Or

GNU FriBidi for c++



来源:https://stackoverflow.com/questions/10154961/looking-for-a-method-for-flipping-bidi-hebrew-text-so-it-would-be-displayed-co

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!