Is the Java String data that I will fetch complete if I have special characters like japanese, greek, chinese, korean, etc. characters stored in my mysql database?
To be clear my question is will the special characters that I fetched in mysql complete if I stored them in java string, and will I able to display them in character form when I use them for text components like JEditorPane
String data;
ResultSet r = sabiNa.executeQuery();
while(r.next()) {
data = r.getString("data");
}
Java is capable of storing ALL valid Unicode text. It uses UTF-16 internally.
If you configure the entire data path correctly, all text will be preserved. You need to ensure:
Note that [the documentation for MySQL] claims UTF-8 is incapable of storing characters outside the Basic Multilingual Plane (all “normal” characters lie within BMP). UTF-8 itself is perfectly capable of storing all unicode characters and the database should be able to encode these characters as well.
Java itself is fine – just remember some rare unicode characters are actually two characters (called a surrogate pair) in Java.