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 71BA611F8812 for ; Mon, 3 Apr 2006 05:52:09 -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 55133-04-4 for ; Mon, 3 Apr 2006 05:52:06 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by postgresql.org (Postfix) with ESMTP id 404C211F872C for ; Mon, 3 Apr 2006 05:52:04 -0300 (ADT) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1FQKn0-0004YS-Dr for pgsql-odbc@postgresql.org; Mon, 03 Apr 2006 10:51:58 +0200 Received: from 83.145.96.118 ([83.145.96.118]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 03 Apr 2006 10:51:58 +0200 Received: from Marc.Herbert by 83.145.96.118 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 03 Apr 2006 10:51:58 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-odbc@postgresql.org From: Marc Herbert Subject: Re: Unicode is not UTF-8. was :psqlODBC-Driver Test / text Date: Mon, 03 Apr 2006 10:55:30 +0200 Lines: 28 Message-ID: References: <442C3452.5020704@online.de> <442C4F10.3090004@tpf.co.jp> <442D5DFB.4080501@online.de> <442DD6E2.5070500@samwel.tk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 83.145.96.118 User-Agent: Gnus/5.1007 (Gnus v5.10.7) XEmacs/21.4 (Jumbo Shrimp, linux) Cancel-Lock: sha1:1jr9ANMZuy1PoOkKjANi++H58bg= X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=1.355 required=5 tests=[AWL=0.102, RCVD_NUMERIC_HELO=1.253] X-Spam-Score: 1.355 X-Spam-Level: * X-Archive-Number: 200604/9 X-Sequence-Number: 7536 Bart Samwel writes: > > C++ even introduced a special alternative character type "wchar_t" for > this, just so that people could handle both 8-bit char* and 16-bit > wchar_t* strings. In wchar_t* strings, 8-bit NULs are not a problem > because only 16-bit NULs count (and AFAIK the Unicode standard does > allows this to be interpreted as a NUL aka end-of-string). The > downside of this solution is that no application actually uses it, and > everybody is stuck with 8-bit ASCII plus a random local codepage > unless special support is added. 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) I don't clearly see how you want to use a 8-bit NULL to terminate a (wider) wchar_t array... ? > Why didn't they just upgrade chars to 32 bits and be done with > it... :-/ Because "char" was and is still used to store multibyte / variable-length / encoded characters.