| От | Peter Eisentraut |
|---|---|
| Тема | client encoding name normalization in psycopg 2.4 |
| Дата | |
| Msg-id | 1302205616.21369.10.camel@vanquo.pezone.net обсуждение исходный текст |
| Ответы |
Re: client encoding name normalization in psycopg 2.4
Re: client encoding name normalization in psycopg 2.4 |
| Список | psycopg |
Psycopg 2.4 now tries to map the PostgreSQL client encoding to a Python codec. But it fails to consider some variant spellings. For example, I have PGCLIENTENCODING=UTF-8 in my environment, which completely breaks the new psycopg version with no Python codec for client encoding 'UTF-8' (The underlying reason for this is that I use export PGCLIENTENCODING=$(locale charmap) which gives variant spelling of encoding names across operating systems.) The PostgreSQL backend normalizes an encoding name by removing all non-alnum characters from it. I suggest psycopg do the same. Attached is a patch that implements that. Note that the PostgreSQL backend version of this actually lowercases the encoding names during normalization. I have made this patch uppercase them to keep the patch smaller, but you may want to consider doing the lowercasing, to keep things consistent.
В списке psycopg по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера