postgresql/src
Tom Lane 2ab0796d7a Fix char2wchar/wchar2char to support collations properly.
These functions should take a pg_locale_t, not a collation OID, and should
call mbstowcs_l/wcstombs_l where available.  Where those functions are not
available, temporarily select the correct locale with uselocale().

This change removes the bogus assumption that all locales selectable in
a given database have the same wide-character conversion method; in
particular, the collate.linux.utf8 regression test now passes with
LC_CTYPE=C, so long as the database encoding is UTF8.

I decided to move the char2wchar/wchar2char functions out of mbutils.c and
into pg_locale.c, because they work on wchar_t not pg_wchar_t and thus
don't really belong with the mbutils.c functions.  Keeping them where they
were would have required importing pg_locale_t into pg_wchar.h somehow,
which did not seem like a good plan.
2011-04-23 12:35:41 -04:00
..
backend Fix char2wchar/wchar2char to support collations properly. 2011-04-23 12:35:41 -04:00
bin Quotes in strings injected into bki file need to escaped. In particular, 2011-04-20 09:59:52 +03:00
include Fix char2wchar/wchar2char to support collations properly. 2011-04-23 12:35:41 -04:00
interfaces Add gitignore entries for Windows MSVC builds 2011-04-19 20:04:41 +03:00
makefiles Allow make check in PL directories 2011-02-15 06:52:12 +02:00
pl Fix PL/Python traceback for error in separate file 2011-04-20 23:19:04 +03:00
port pgindent run before PG 9.1 beta 1. 2011-04-10 11:42:00 -04:00
template Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
test Allow ALTER TYPE .. ADD ATTRIBUTE .. CASCADE to recurse to descendants. 2011-04-20 22:49:37 -04:00
timezone Update time zone data files to tzdata release 2011f. 2011-04-13 18:03:23 -04:00
tools Small update to emacs example configuration 2011-04-23 00:47:01 +03:00
tutorial Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
bcc32.mak Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Fix some oversights in distprep and maintainer-clean targets. 2011-03-10 00:04:05 -05:00
Makefile.global.in Rename pg_regress option --multibyte to --encoding 2011-04-15 08:42:05 +03:00
Makefile.shlib Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
nls-global.mk Fix makefile logic to not break the build when xgettext is missing 2010-10-14 23:16:46 +03:00
win32.mak Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00