diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2004-05-07 00:24:59 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2004-05-07 00:24:59 +0000 |
commit | 0bd61548ab8d1ac5fee63f48ee9b384502a51ad6 (patch) | |
tree | b0c63b75585d0c396e67a3acd204e226b13eae4b /src/include/regex/regcustom.h | |
parent | 4d46274b33db52618ccf49550213b4d5ce4a7981 (diff) | |
download | postgresql-0bd61548ab8d1ac5fee63f48ee9b384502a51ad6.tar.gz postgresql-0bd61548ab8d1ac5fee63f48ee9b384502a51ad6.zip |
Solve the 'Turkish problem' with undesirable locale behavior for case
conversion of basic ASCII letters. Remove all uses of strcasecmp and
strncasecmp in favor of new functions pg_strcasecmp and pg_strncasecmp;
remove most but not all direct uses of toupper and tolower in favor of
pg_toupper and pg_tolower. These functions use the same notions of
case folding already developed for identifier case conversion. I left
the straight locale-based folding in place for situations where we are
just manipulating user data and not trying to match it to built-in
strings --- for example, the SQL upper() function is still locale
dependent. Perhaps this will prove not to be what's wanted, but at
the moment we can initdb and pass regression tests in Turkish locale.
Diffstat (limited to 'src/include/regex/regcustom.h')
-rw-r--r-- | src/include/regex/regcustom.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/include/regex/regcustom.h b/src/include/regex/regcustom.h index 2d111f796be..9b0c691de03 100644 --- a/src/include/regex/regcustom.h +++ b/src/include/regex/regcustom.h @@ -25,7 +25,7 @@ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $PostgreSQL: pgsql/src/include/regex/regcustom.h,v 1.3 2003/11/29 22:41:10 pgsql Exp $ + * $PostgreSQL: pgsql/src/include/regex/regcustom.h,v 1.4 2004/05/07 00:24:58 tgl Exp $ */ /* headers if any */ @@ -59,10 +59,10 @@ typedef int celt; /* type to hold chr, MCCE number, or #define CHR_MAX 0xfffffffe /* CHR_MAX-CHR_MIN+1 should fit in uchr */ /* functions operating on chr */ -#define iscalnum(x) pg_isalnum(x) -#define iscalpha(x) pg_isalpha(x) -#define iscdigit(x) pg_isdigit(x) -#define iscspace(x) pg_isspace(x) +#define iscalnum(x) pg_wc_isalnum(x) +#define iscalpha(x) pg_wc_isalpha(x) +#define iscdigit(x) pg_wc_isdigit(x) +#define iscspace(x) pg_wc_isspace(x) /* and pick up the standard header */ #include "regex.h" |