X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id A4E1811F6D21 for ; Mon, 3 Apr 2006 06:04:46 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 57548-06 for ; Mon, 3 Apr 2006 06:04:45 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from samwel.tk (bsamwel.xs4all.nl [82.92.179.183]) by postgresql.org (Postfix) with ESMTP id E769411F6D07 for ; Mon, 3 Apr 2006 06:04:41 -0300 (ADT) Received: from localhost ([127.0.0.1]) by samwel.tk with esmtp (Exim 4.60) (envelope-from ) id 1FQKzD-0006aU-4p; Mon, 03 Apr 2006 11:04:35 +0200 Message-ID: <4430E4EC.2010208@samwel.tk> Date: Mon, 03 Apr 2006 11:03:40 +0200 From: Bart Samwel User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 To: Marc Herbert CC: pgsql-odbc@postgresql.org Subject: Re: Unicode is not UTF-8. was :psqlODBC-Driver Test / text References: <442C3452.5020704@online.de> <442C4F10.3090004@tpf.co.jp> <442D5DFB.4080501@online.de> <442DD6E2.5070500@samwel.tk> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: bart@samwel.tk X-SA-Exim-Scanned: No (on samwel.tk); SAEximRunCond expanded to false X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.071 required=5 tests=[AWL=0.071] X-Spam-Score: 0.071 X-Spam-Level: X-Archive-Number: 200604/10 X-Sequence-Number: 7537 Marc Herbert wrote: > Bart Samwel writes: > wchar_t is not defined as 16-bits, but as "wide enough to hold any > character of the platform". For instance if the platform uses UCS-4, > then wchar_t is 32 bits wide. > > (UTF-16 wchar_t violates this) Ahhh, this explains a lot. The same assumption used to be true for char until they came up with UTF-8 char. And they couldn't just upgrade char because too much code assumed that char was one byte. Then platforms started to use UCS-2 wchar_t, then upgraded those to UTF-16 because they couldn't just upgrade wchar_t because too much code assumed that wchar_t was two bytes. Same pattern. Time to introduce wwchar_t_t. :-) > I don't clearly see how you want to use a 8-bit NULL to terminate a > (wider) wchar_t array... ? This was a backreference to a situation mentioned earlier in the discussion, where wchar_t buffers couldn't be "tunneled through" a layer that used char*, as the wider wchar_t characters may contain NUL bytes. Cheers, Bart