We ran some java code using cron on Linux to store thousands of records in a production database. In this charmap field was "ANSI_X3.4-1968". Now we have completed the following steps before transferring them to the database. 1. Use StringEscapeUtils.unescapeHtml4 in the text 2. Write the string in UTF-8 format and save it in the database
Now the problem is that after these steps, special characters are displayed as "?". Is it possible to return it back to the original? I simulated a problem with the following steps.
- Change Eclipse Encoding to "ANSI_X3.4-1968"
- Enter the following lines of code
String insertSpecial = StringEscapeUtils.unescapeHtml4("×");
System.out.println(insertSpecial);
String uni = new String(insertSpecial.getBytes(), "UTF-8");
System.out.println(uni);
Now I want to return "×" from the string "uni". Any help would be appreciated.