Convert string to unicode

23,315

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.

Share:
23,315
mGol
Author by

mGol

Updated on November 24, 2020

Comments

  • mGol
    mGol over 3 years

    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 .