Re: Perl DBI converts UTF-8 again to UTF-8 before sending it to theserver
В списке pgsql-general по дате отправления:
| От | Christoph Moench-Tegeder |
|---|---|
| Тема | Re: Perl DBI converts UTF-8 again to UTF-8 before sending it to theserver |
| Дата | |
| Msg-id | 20191004142932.GA2532@elch.exwg.net обсуждение исходный текст |
| Ответ на | Perl DBI converts UTF-8 again to UTF-8 before sending it to theserver (Matthias Apitz <guru@unixarea.de>) |
| Ответы |
Re: Perl DBI converts UTF-8 again to UTF-8 before sending it to theserver
|
| Список | pgsql-general |
## Matthias Apitz (guru@unixarea.de): > my $text = "\xc3\xa4"; > print "text: ".$text."\n"; Your output is lying to you: you need a binmode(STDOUT, ':encoding(utf8)'), which will make this print "ä", and a utf8::decode($text), after which you get "ä". And when you pass that $text through DBD::Pg, it will still be an "ä". And when you change $text to "ä", it still works. Most other combinations will either fail with "\xc3\xa4" or "ä". Welcome to modern perl's handling of utf8. Cue "Everything is Fine" meme. Regards, Christoph -- Spare Space
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера