X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id BFB5352A56 for ; Thu, 24 Feb 2005 17:43:52 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 40021-08 for ; Thu, 24 Feb 2005 17:43:50 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 8F4B452A4D for ; Thu, 24 Feb 2005 17:43:49 +0000 (GMT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j1OHi1oM025980; Thu, 24 Feb 2005 12:44:01 -0500 (EST) To: Bjoern Metzdorf Cc: pgsql-hackers@postgreSQL.org Subject: Re: [ADMIN] invalid multibyte character for locale In-reply-to: <421E0D6B.6010303@turtle-entertainment.de> References: <421CF15C.6010306@turtle-entertainment.de> <421CF1CE.3000800@turtle-entertainment.de> <23514.1109203127@sss.pgh.pa.us> <421D8541.2000904@turtle-entertainment.de> <24832.1109258150@sss.pgh.pa.us> <421E0D6B.6010303@turtle-entertainment.de> Comments: In-reply-to Bjoern Metzdorf message dated "Thu, 24 Feb 2005 18:22:51 +0100" Date: Thu, 24 Feb 2005 12:44:00 -0500 Message-ID: <25979.1109267040@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.008 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200502/774 X-Sequence-Number: 64602 Bjoern Metzdorf writes: > I assume I could just remove > #define USE_WIDE_UPPER_LOWER > from oracle_compat.c to emulate the old behaviour. But a cleaner fix > would be to check if we are using UNICODE and locale is C or POSIX and > only then skip USE_WIDE_UPPER_LOWER. Perhaps it would be reasonable to do something like this: #ifdef USE_WIDE_UPPER_LOWER /* * use wide char code only when max encoding length > one * and we aren't in C locale */ if (pg_database_encoding_max_length() > 1 && !lc_ctype_is_c()) { where lc_ctype_is_c() is the obvious clone of the existing lc_collate_is_c() routine. We can reasonably assume that mbstowcs is going to be unable to offer any useful behavior in C locale. Comments? regards, tom lane