Convert International String to \u Codes in java

there is a JDK tools executed via command line as following : native2ascii -encoding utf8 src.txt output.txt Example : src.txt بسم الله الرحمن الرحيم output.txt \u0628\u0633\u0645 \u0627\u0644\u0644\u0647 \u0627\u0644\u0631\u062d\u0645\u0646 \u0627\u0644\u0631\u062d\u064a\u0645 If you want to use it in your Java application, you can wrap this command line by : String pathSrc = “https://stackoverflow.com/questions/6230190/./tmp/src.txt”; String pathOut = “./tmp/output.txt”; … Read more

Removing unicode \u2026 like characters in a string in python2.7 [duplicate]

Python 2.x >>> s ‘This is some \\u03c0 text that has to be cleaned\\u2026! it\\u0027s annoying!’ >>> print(s.decode(‘unicode_escape’).encode(‘ascii’,’ignore’)) This is some text that has to be cleaned! it’s annoying! Python 3.x >>> s=”This is some \u03c0 text that has to be cleaned\u2026! it\u0027s annoying!” >>> s.encode(‘ascii’, ‘ignore’) b”This is some text that has to be … Read more