Monday, September 9, 2013

Convertion Russian characters to one with Unicode-encoded characters for Java application


  1.  Online http://native2ascii.net .
  2. With utillity natime2ascii in Sun JDK.

    Documentation: http://docs.oracle.com

    Create a file:
    touch ~/Test.txt

    Write to file Russian characters:
    echo Русский > Test.txt

    Go to the Java jdk bin directory:
    cd 
    /usr/lib/jvm/jdk1.7.9/bin

    And run the natime2ascii:
    ./native2ascii -encoding UTF-8 ~/Test.txt ~/Test.txt

    Look in the file:
    less ~/Test.txt
     \u0420\u0443\u0441\u0441\u043a\u0438\u0439


No comments:

Post a Comment