Re: Encoding conversion problem



Andrea wrote:

I have a J2EE application which connects to a DB2 configured with code
set IBM-850. The application works with encoding ISO-8859-1.

In general the JDBC-driver is aware of the encoding, the database
is using and is doing the conversion already if you access the
column by getString(columnName/index).

I tried encoding conversions with InputStreamReader and
OutputStreamWriter:
...
BufferedReader reader = new BufferedReader(new
InputStreamReader(source, "IBM850"));

What is source? How do you create that from the JDBC-
resultset?

BufferedWriter writer = new BufferedWriter(new
OutputStreamWriter(output, "ISO-8859-1"));

That looks OK.


Regards, Lothar
--
Lothar Kimmeringer E-Mail: spamfang@xxxxxxxxxxxxxx
PGP-encrypted mails preferred (Key-ID: 0x8BC3CD81)

Always remember: The answer is forty-two, there can only be wrong
questions!
.



Relevant Pages

  • Re: VW --> Bianary file into CLOB or BLOB
    ... Page 1252 encoding, which is normal Windows encoding for Western European ... the database as I manage this on both PostgreSQL, Oracle and ODBC ... My outstanding problem was to create a valid ByteArray from no matter ...
    (comp.lang.smalltalk)
  • Re: VW --> Bianary file into CLOB or BLOB
    ... Page 1252 encoding, which is normal Windows encoding for Western European alphabets. ... the database as I manage this on both PostgreSQL, Oracle and ODBC following the documentation. ... My outstanding problem was to create a valid ByteArray from no matter what file as I previously used the ByteArray coming from ImageReader. ...
    (comp.lang.smalltalk)
  • Re: Arabic Lanaguage support
    ... "Encoding type:" It remains blank by default. ... >> in retrieving records from the database. ... >> '%1%2%3+' etc and retrieve no records although these ... >>> A hyperlink can not retrieve data from a database. ...
    (microsoft.public.frontpage.programming)
  • Re: Sql server to xml string with encoding
    ... But the data is stored in ISO-8859-9 in the database. ... encoding when writing to the stream instead of UTF-8 wich the data is not? ... > Rather than writing to a MemoryStream, write to a StringWriter. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: text datatype support
    ... Unicode or in the default character encoding of the database. ... True means that string parameters are sent to SQL Server in ...
    (microsoft.public.sqlserver.jdbcdriver)