| От | Peter Bauer |
|---|---|
| Тема | bytea to varchar using different charsets |
| Дата | |
| Msg-id | 200801291013.01390.peter.bauer@apus.co.at обсуждение |
| Список | pgsql-general |
Hi all, i would like to write a PL/PGSQL function to convert a bytea into a varchar using the character maps GSM 03.38 (http://en.wikipedia.org/wiki/Short_message_service) and ISO 8859-1 (http://en.wikipedia.org/wiki/Iso_8859-1#ISO-8859-1). The first approach would be to loop through the bytes and map each of them to a character and thus build up the string. The question is if there already exists such a functionality or how the mapping could be done in an elegant way. What i found was convert(string using conversion_name) from http://www.postgresql.org/docs/8.2/static/functions-string.html with the various Built-in Conversions and chr(int) which is only available for the ASCII charset. thx, Peter -- Peter Bauer APUS Software G.m.b.H. A-8074 Raaba, Bahnhofstrasse 1/1 Email: peter.bauer@apus.co.at Tel: +43 316 401629 24 Fax: +43 316 401629 9
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера