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@xxxxxxxxxx Tel: +43 316 401629 24 Fax: +43 316 401629 9 ---------------------------(end of broadcast)--------------------------- TIP 6: explain analyze is your friend