Encoding conversion API

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Encoding conversion API
Дата
Msg-id 200701160108.45583.peter_e@gmx.net
обсуждение исходный текст
Список pgsql-hackers
I'm becoming confused by the encoding conversion API, in particular by 
the function

pg_do_encoding_conversion(unsigned char *src, int len, int src_encoding, 
int dest_encoding);

Since the function in various circumstances passes back src directly, 
you might get back a string that encompasses the equivalent of more 
than len bytes of src.  Or if you pass a string that is not 
null-terminated (which would appear to be allowed, since you pass len), 
you might get back a null-terminated string or not.  And if you don't, 
you don't know how long it is.  So it seems that the only safe way to 
work with this is that src must be a regular null-terminated string, 
but then why must len be passed?

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Darcy Buskermolen
Дата:
Сообщение: Re: Autovacuum improvements
Следующее
От: "Takayuki Tsunakawa"
Дата:
Сообщение: Re: [GENERAL] Checkpoint request failed on version 8.2.1.