Home arrow static arrow Java Programming [Archive] - Unicode characters - JAR works on 1 PC but not on other
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - Unicode characters - JAR works on 1 PC but not on other
This topic has 3 replies on 1 page.

Posts:3,369
Registered: 24.10.97
Unicode characters - JAR works on 1 PC but not on other  
Aug 6, 2004 5:18 AM



 
I save my Java source with UTF-8. During development, i had no problems using special characters like the german Umlaut "�" in the source and test the application. Afetr deploying (basically copying the JAR file) to a Windows 2003 server computer, i got errors because the umlauts weren't translated correctly. I had to replace my "�" occurrences in the Java source with the unicode "\u00C4" to get it working again.

I really wonder why using the special characters directly works on one computer and not on the other. As both use the very same Windows Java Virtual Machine, i thought i could depend on "write once, run anywhere" ... at least for strings and special characters ...?
 

Posts:2,909
Registered: 13.8.2003
Re: Unicode characters - JAR works on 1 PC but not on other  
Aug 6, 2004 5:30 AM (reply 1 of 3)



 
Are you recompiling the source on the windows machine? Or do you mean that the application doesn't work?

This sounds very bizarre and there must be some bug/feature behind this.
 

Posts:3,369
Registered: 24.10.97
Re: Unicode characters - JAR works on 1 PC but not on other  
Aug 6, 2004 6:20 AM (reply 2 of 3)



 
no recompilation, just copy the JAR file to the file server and start it from there. in my case, the strings are part of SQL statements, and with wrong characters those statements fail. again the very same JAR file double clicked on my Windows 2000 professional workstation works. If copied the JAR file to a network file system and then double click it from there (i.e. the same Windows 2000 professional workstation is starting it => same JVM), this error occurs, if i don't escape the umlauts with the long crypting unicode codes.
 

Posts:3,055
Registered: 18/06/98
Re: Unicode characters - JAR works on 1 PC but not on other  
Aug 6, 2004 7:02 AM (reply 3 of 3)



 
"The strings are part of SQL statements" - what JDBC driver are you using? What database? The versions of the drivers, or the language locale, are different in the different PCs? Are you using PreparedStatements ("UPDATE sometable SET field = ?", setString(1, "Hübsch"), ) or concatenating strings ("UPDATE sometable SET field = 'Hübsch'") ?
 
This topic has 3 replies on 1 page.