Remove our dependencies on MB_CUR_MAX in favor of believing that
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 15 Dec 2008 14:55:50 +0000 (14:55 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 15 Dec 2008 14:55:50 +0000 (14:55 +0000)
commitc4ea04032a1848b7f8c3084a3ba5ad35c6c6ddaa
treefeb2199bd27599f3796785823180983f172426c5
parent0bbede61a4e9cc0851b9865dc5367c407fb5afca
Remove our dependencies on MB_CUR_MAX in favor of believing that
pg_database_encoding_max_length() predicts the maximum character length
returned by wchar2char().  Per Hiroshi Inoue, MB_CUR_MAX isn't usable on
Windows because we allow encoding = UTF8 when the locale says differently;
and getting rid of it seems a good idea on general principles because it
narrows our dependence on libc's locale API just a little bit more.

Also install a check for overflow of the buffer size computation.
src/backend/utils/adt/formatting.c