On 12/14/2012 09:49 AM, Adrian Klaver wrote:
> Original Poster
Thanks. And more info:
Mysql
+--------------------------+--------+
| Variable_name | Value |
+--------------------------+--------+
| character_set_client | latin1 |
| character_set_connection | latin1 |
| character_set_database | latin1 |
| character_set_filesystem | binary |
| character_set_results | latin1 |
| character_set_server | latin1 |
| character_set_system | utf8 |
+--------------------------+--------+
SHOW VARIABLES LIKE "character\_set\_database";
+------------------------+--------+
| Variable_name | Value |
+------------------------+--------+
| character_set_database | latin1 |
+------------------------+--------+
Psql everywhere is utf8.
Where could be the problem located?
Also by using the java encoding methods, all characters except "È" are
transformed correctly.
Thanks alot!
Emi
--
public static String utf8_to_latin1(String str)
throws Exception
{
try
{
if(str.indexOf("È")>=0)
{
str = str.replaceAll("È", "E");
}
byte[] convertStringToByte = str.getBytes("UTF-8");
str = new String(convertStringToByte,
"ISO-8859-1");
return str;
}catch(Exception e)
{
log.error("utf8_to_latin1 Error: " + e.getMessage());
log.error(e);
throw e;
}
}