Multilanguage
Hi Experts,
I have read the internationalization tutorial and still can't put it all together. I get resource bundles and making sure I compare strings properly but I don't get when or how to convert Unicode to UTF-8 or UTF-8 to Unicode.
I must add multilanguage support to a remote ordering application. The application is installed on the User's computer and when the User wants to place an order the application accepts and checks the input then sends it to a MySQL database. The User can also use the application to review past orders and those are then retrieved from the server. The application uses Perl/CGI scripts on the server to save and retrieve orders.
Currently I set my Windows box up for say Turkish input text and keyboard and locale. I then start the application and can successful input and have displayed the special Turkish characters. The order is also successfully stored in the MySQL database with the unique Turkish characters.
The problem arises when I want to retrieve an order. The application loads the data in JLabel fields, JTextFields and a JComboBox. The JLabel fields and JTextFields do not display the data correctly and the JComboBox does. The data that goes into the JComboBox correctly is displayed incorrectly in a JTextField. The stuff going into the combo box first gets put into a String and if the String is unique it will be put in the combo box. So as I typed this help request did I solve my problem (*see the last part of the code section). Could I just cast each value as a String right before putting it into the JLabel or JTextField?
The code below is how communication is carreid out via a URL HTTP connection and the incoming data is loaded into a properties list which is returned to the caller (see the code section below).
Please be kind and suggest some direction or solution. Thank you.
//try connecting
URL u =new URL(Url +".cgi?" + Login + args);
HttpURLConnection connection = (HttpURLConnection)u.openConnection();
if( connection.getResponseCode() != HttpURLConnection.HTTP_OK ){
thrownew LoginException( connection.getResponseMessage() );
}
table.load(u.openStream());//url is valid and exists, so load the table
//catch any problems
return table;
_
//else where in the app the calling method receives the properties list 'p'
//and puts data incorrectly into the various JLabels and JTextFields similar to the following
model.setText(p.getProperty("model"));
// * it's after midnight for me I will test tomorrow my newest idea ->instead of the above if I do the following will it work?
model.setText( (String) p.getProperty("model"));

