用Java编写阿拉伯字母 [英] Writing arabic letters in Java

查看:26
本文介绍了用Java编写阿拉伯字母的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想让在我的服务器上用阿拉伯语书写成为可能.它可以工作,但从左到右,所以我使用了 StringUtils.reverse(_text) 现在我的文本是从 RTL 编写的,但问题是:文字是分开写的 ( e x a m p l e )

I want to make it possible to write in Arabic in my server. It works but from left to right so I used that StringUtils.reverse(_text) now my text is written from RTL but the problem is this: the text is written separately ( e x a m p l e )

在我的记录器中

Log.LogChat(_type.name(), activeChar.getName(), _target, _text); 

聊天在我的log.txt中是正确写的,但在游戏中却是用空格写的

the chat is written correctly in my log.txt, but in the game it's written with spaces

// arabic chat
Say2 cs = new Say2(activeChar.getObjectId(), _type, activeChar.getName(), StringUtils.reverse(_text));

有人知道为什么吗?

推荐答案

你不想反转字符串"!

相反,您希望将应用程序的文本翻译成阿拉伯语……并且希望该文本以阿拉伯语显示.这将自动处理从右到左.

Instead, you want to translate your application's text to Arabic ... and you want that text displayed in Arabic. Which will automatically handle Right-to-Left.

您想使用 Java语言环境".

You want to utilize Java "locales".

查看这些链接:

http://www.oracle.com/technetwork/articles/javase/locale-140624.html

http://docs.oracle.com/javase/tutorial/i18n/locale/create.html

https://blogs.oracle.com/geertjan/entry/tips_for_arabic_java_desktop

这篇关于用Java编写阿拉伯字母的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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