Re: pg jdbc driver
| От | Dino Nardini |
|---|---|
| Тема | Re: pg jdbc driver |
| Дата | |
| Msg-id | 5.2.0.9.2.20040808221302.01b22fd8@pop.rivendellsoftware.com обсуждение исходный текст |
| Ответ на | Re: pg jdbc driver (Kris Jurka <books@ejurka.com>) |
| Список | pgsql-general |
Yes, I have the database encoding set to SQL_ASCII, which hasn't been a problem with ColdFusion 5. As you say, the server has been blindly passing the data back and forth. However, when I tested the same data with ColdFusion MX (built on a Java platform), I ran into problems. The french characters were either throwing "Invalid character..." errors, or displaying as garbage. I'm guessing that CFMX was trying to convert the characters from SQL_ASCII to something else (UTF-8?) somewhere between the database and the web page. I've managed to get CF5 installed on the new server for now, but I plan to do some more testing with CFMX. Probably have to dump the database, re-create with UNICODE encoding, and restore. I suspected that the problem originated with encoding at the CFMX level, but I wanted to cover all bases. Thanks for the feedback. Cheers... Dino At 07:14 PM 08/08/2004 -0500, you wrote: >On Sat, 7 Aug 2004, Dino Nardini wrote: > > > [Could the JDBC driver be causing the problems I'm seeing with my > > website after moving from ColdFusion with ODBC? ] > >Unlikely. A common problem people find when using PostgreSQL's JDBC >driver is that they have setup their database with SQL_ASCII encoding >which doesn't have any information on what high-bit characters actually >represent. Many applications are OK with this and blindly pass data back >and forth, but Java requires having correctly encoded data and the JDBC >driver will error out with something like "Invalid character data was >found..." You reported problems correctly displaying this data, not an >error, so I doubt that is the issue. > >As I mentioned Java is (sometimes painfully) encoding aware. I'm not >familar with ColdFusion, but you likely need to set the page encoding >correctly for converting Java Strings into bytes. This can be >accomplished in a number of ways, for example set globally via the >file.encoding system property or on per page basis via methods in >javax.servlet.ServletResponse such as setCharacterEncoding, >setContentType, and setLocale. > >Kris Jurka _____________________________________ Rivendell Software - Dynamic Web Solutions http://www.rivendellsoftware.com Tel 902.461.1697 Fax 902.461.3765
В списке pgsql-general по дате отправления: