Hi all, the JDBC Driver uses ISO 8859-1 for encoding of Strings into CHAR ASCII, VARCHAR ASCII and LONG VARCHAR columns. This is mainly because of simplicity and performance, and coherence with the internal workings of the database (UPPER, LOWER functions, for example).
The Euro Sign is Unicode Character 0x20AC. In the following Windows codepages it is at position 0x80: 1250 Eastern European, 1252 Western, 1253 Greek, 1254 Turkish, 1257 Baltic, 1255 Hebrew, 1256 Arabic, 1258 Vietnamese, 874 Thai. In 1251 Cyrillic the symbol is at '0x88'. It does work in Python because the CHAR ASCII type is 8-bit clean, so if you put a 0x80, you will get a 0x80 back. I can only suggest using an UNICODE database if possible. Regards Alexander Schröder SAP Labs Berlin PS: The Java property 'file.encoding' does control how 8-bit text files are emitted/read in. Under Windows this is the codepage your system has set (probably containing euro at 0x80), under Linux/Sun it is 7-bit Ascii :-( > -----Original Message----- > From: Sven Köhler [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, January 07, 2003 9:29 PM > To: [EMAIL PROTECTED] > Subject: Re: Euro Sign and JDBC > > > > I have a problem with the Euro sign! > > I am using a Sapdb 7.3 and the latest JDBC-Driver. The > database is *not* set up as a unicode db. Just like the > normal Sample-Database. > > This might a bug within the Charset-stuff of Java. > question for Alex. Schröder: > Which charset is the JDBC-driver using, to send the Strings to the > database? > > I tried to produce a Java-File that outputs an €-sign, but i have > troubles, because the char isn't shown correctly on the > console, and i > haven't tried a GUI-app yet. > > > First I thought, it could be the JDBC-Driver but then I > tested it with python and it worked there. > > I can write and read the sign with Python. > > It might work with Python, but does Python use Unicode? > If it uses String with 8-bit per char, than the SAPDB's > Python-API might > just send the string as-is. > > > What can I do to handle the Euro-Sign in Java Apps? > > Use a Unicode-DB. > > > Does anybody have some experience with this behaviour? > > I'm writing a web-app which uses UTF-8 encoding of the pages, UTF-8 > encoding for POST-Data, the Querystring etc. > Of course i'm using a Unicode-DB. > Java uses 2byte Unicode, so i think that it's a good idea to use a > Unicode-DB too. There will be no encoding/decoding while querying > strings from the DB. > > It works perfectly here with my web-app. Every char i can think of is > shown correctly. > > > _______________________________________________ > sapdb.general mailing list > [EMAIL PROTECTED] > http://listserv.sap.com/mailman/listinfo/sapdb.general > _______________________________________________ sapdb.general mailing list [EMAIL PROTECTED] http://listserv.sap.com/mailman/listinfo/sapdb.general
