RE: JDBC and Unicode problem
От | Zeljko Trogrlic |
---|---|
Тема | RE: JDBC and Unicode problem |
Дата | |
Msg-id | 4.1.20000906143455.01910170@pop.tel.hr обсуждение исходный текст |
Ответ на | JDBC and Unicode problem (Zeljko Trogrlic <zeljko@technologist.com>) |
Список | pgsql-interfaces |
Solution for automatic encoding detection: * Make a Hashmap that maps PostgreSQL encoding names to Java encoding names (UNICODE = UTF-8) * When getConnection is called, execute select getdatabaseencoding(). This will return encoding name. * Get Java encoding name and store it into connection specific variable. * When executing SQL-s or reading data, use that encoding as parameter. In getString, replace:return new String(this_row[columnIndex - 1]); withreturn new String(this_row[columnIndex - 1], encoding); And JDBC will work for all encodings entered into mapping Hashmap. If I only had write CVS access... ;) At 10:01 6.9.2000 , Peter Mount wrote: >It isn't a bug as such as I've never implemented unicode. > >However, your solution looks like a good one, but I'm not sure how you would >pass that parameter to either an applet or a servlet.
В списке pgsql-interfaces по дате отправления: