Ref: https://www.branah.com/unicode-converter
I'm new in scala and java and trying to writ a .properties file (in few languages like Chinese,french,German etc ) using scala for internationalization functionality. For that I'm using following code:
for ((key, val) <- jsonData.get.asInstanceOf[Map[String, String]]) {
var file: PrintWriter = null
file = new PrintWriter(filepath, "UTF-8")
prop.setProperty(key, val)
prop.store(file, "")
file.close()
}
So this code is working but its writing file in UTF-8 format like:
传播特征 设计师 考虑 测量 düşünce
which is not rendering properly in browser so instead of that I want to convert it into the UTF-16 unicode format like:
\u4f20\u64ad\u7279\u5f81 \u8bbe\u8ba1\u5e08 \u8003\u8651 \u6d4b\u91cf \u0064\u00fc\u015f\u00fc\u006e\u0063\u0065
As per this converter: https://www.branah.com/unicode-converter
I don't have access of client side so can't post that code here but I'm sure its same like fetching data from .properties file through ajax and rendering it on browser.
How can I convert it into utf-16 unicode so that it'll render properly in browser.
Any help would be appreciated.