Library for converting native2ascii and vice versa

前端 未结 2 1244
一生所求
一生所求 2021-01-05 09:49

I\'m searching for a library (Apache / BSD / EPL licensed) to convert native text to ASCII using \\u for characters not available in ASCII (basically what java.util.Properti

2条回答
  •  不知归路
    2021-01-05 10:29

    Try this piece of code from Apache commons-lang:

    StringEscapeUtils.escapeJava("ایران زیبای من");
    StringEscapeUtils.unescapeJava("\u0627\u06CC\u0631\u0627\u0646 \u0632\u06CC\u0628\u0627\u06CC \u0645\u0646");
    

提交回复
热议问题