将字符串转换为unicode [英] Convert string to unicode
问题描述
我想在Android中将诸如我的简单文本之类的简单文本转换为Unicode字符。
例如:
\u0628\u0631\u0646\u0627\u0645\u0647 \u0646\u0648\u06cc\u0633\u06cc
此字符串在uni代码中是:
برنامهنویسی
我要输入
برنامهنویسی
和响应
\u0628\u0631\u0646\u0627\u0645\u0647 \u0646\u0648\u06cc\u0633\u06cc
此字符串。请帮助我。
Android本机是Java,所以..检查此:
您可以在这里使用一个内衬对任何Java字符进行处理:
System.out.println( u + Integer.toHexString('÷'| 0x10000).substring(1));
参考: 我希望我能帮助回答您的一些问题。
i want convert a simple text like, "my simple text" to Unicode character in Android.
for example this :
"\u0628\u0631\u0646\u0627\u0645\u0647 \u0646\u0648\u06cc\u0633\u06cc"
this string in uni code is :
برنامه نویسی
i want input
برنامه نویسی
and response
"\u0628\u0631\u0646\u0627\u0645\u0647 \u0646\u0648\u06cc\u0633\u06cc"
this string . please help me .
Android native its java, so.. check this:
You can do it for any Java char using the one liner here:
System.out.println( "\\u" + Integer.toHexString('÷' | 0x10000).substring(1) );
Reference: Get unicode value of a character
I hope that I have helped answer some of your questions.
这篇关于将字符串转换为unicode的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!