Re: WE8ISO8859P1 convert to AL32UTF8 unicode character set question
Date: Fri, 10 Apr 2009 14:23:43 +0200
> But a little more complex.
> I use java to read the both WE8ISO8859P1 and WE8MSWIN1252 dbs
> 1 in WE8ISO8859P1 db, I print rs.getBytes("c1") array, the result is
> as below, so it should be already unicode, and it does not do any
> -123 ===========>> as same as 256-123 = 133
rs.getBytes()?? Why would you select a string as Bytes? Can you show your code?
I inserted your byte sequence into a WE8ISO8859P1 database, and selected it with getString() with JDBC, and I got what I expected:
> 2 in WE8MSWIN1252 db, I print rs.getBytes("c1") array, the result is
> as below, looks it is converted after it is read.
> -65 ===========>> as same as 256-65 = 191
> If we use item 1 to convert, they are all wrong, but the UI are same
> even they are wrong.
> If we use item 2 to convert, the before is wrong, but after convert,
> it is correct. but the UI will be different.
I do not understand.
Your example 2 does not seem to be correct, but I don't know what you did.
> To be consistent, I choose item 1. At least, the data is not lost from
> UI in both before and after..
> If client cannot afford it, he/she should correct it at very early
> This is not one technical question, it is choose question.
As I said, it's a time bomb.
Choose to either fix it now or maybe blow up later.
For example as soon as the customer wishes to insert a character that is not in the Windows character set.
You can choose to ignore it, but I would at least tell my customer that there are corrupt data in the database.
Laurenz Albe Received on Fri Apr 10 2009 - 07:23:43 CDT