This post has been edited by zakhussain299: 06 August 2012 - 01:11 PM
ISO8859-1 to UTF-8 encoding issue
Page 1 of 16 Replies - 286 Views - Last Post: 06 August 2012 - 02:56 PM
#1
ISO8859-1 to UTF-8 encoding issue
Posted 06 August 2012 - 01:00 PM
I have a database which uses the encoding ISO8859_1. I have a spring MVC application that takes the data from the server and displays it on a web page. However my Linux server has the default encoding UTF-8. I am using JDBC connection to get the data from the database. The problem is that data from the database gets corrupted with garbage values when it reaches the server as there is an encoding mismatch. When I try to convert the encoding of the string from the result set to UTF-8 I end up with a string that contains "?". It is trying to encode the garbage string to UTF-8 and that's why I end up with question mark string. I have been trying to solve this problem for a while now. If someone has encountered this type of situation then I will be glad to here your answer. (PS: I cannot change the encoding of the database or the server)
Replies To: ISO8859-1 to UTF-8 encoding issue
#2
Re: ISO8859-1 to UTF-8 encoding issue
Posted 06 August 2012 - 01:26 PM
You're sure that the db driver knows to use ISO8859-1?
#3
Re: ISO8859-1 to UTF-8 encoding issue
Posted 06 August 2012 - 01:43 PM
g00se, on 06 August 2012 - 01:26 PM, said:
You're sure that the db driver knows to use ISO8859-1?
Yes. The web application is deployed on an application server and when I change the encoding of the application server from the default to ISO8859-1 everything works fine. But I am trying to figure out a way to make it work on the default encoding of UTF-8.
#4
Re: ISO8859-1 to UTF-8 encoding issue
Posted 06 August 2012 - 01:49 PM
Quote
Yes. The web application is deployed on an application server and when I change the encoding of the application server from the default to ISO8859-1 everything works fine.
Your second sentence actually suggests to me that your first sentence should actually be 'No.'
Precisely how are you ensuring that the driver knows to use ISO8859-1?
This post has been edited by g00se: 06 August 2012 - 01:50 PM
Reason for edit:: typo
#5
Re: ISO8859-1 to UTF-8 encoding issue
Posted 06 August 2012 - 01:56 PM
g00se, on 06 August 2012 - 01:49 PM, said:
Quote
Yes. The web application is deployed on an application server and when I change the encoding of the application server from the default to ISO8859-1 everything works fine.
Your second sentence actually suggests to me that your first sentence should actually be 'No.'
Precisely how are you ensuring that the driver knows to use ISO8859-1?
I got that information from my database admin. According to him the server is encoded for ISO8859-1.
This post has been edited by zakhussain299: 06 August 2012 - 01:57 PM
#6
Re: ISO8859-1 to UTF-8 encoding issue
Posted 06 August 2012 - 02:31 PM
Quote
I got that information from my database admin. According to him the server is encoded for ISO8859-1.
It's nothing to do (directly) with the database encoding/configuration. It's to do with the configuration of how the driver connects to the database. If you don't tell it what the db encoding is, it might well just assume it's the same as the platform default (UTF-8) which, of course, is quite wrong.
#7
Re: ISO8859-1 to UTF-8 encoding issue
Posted 06 August 2012 - 02:56 PM
g00se, on 06 August 2012 - 02:31 PM, said:
Quote
I got that information from my database admin. According to him the server is encoded for ISO8859-1.
It's nothing to do (directly) with the database encoding/configuration. It's to do with the configuration of how the driver connects to the database. If you don't tell it what the db encoding is, it might well just assume it's the same as the platform default (UTF-8) which, of course, is quite wrong.
Thank you. That's what I thought.
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote



|