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 7F28D11F6BB5 for ; Fri, 31 Mar 2006 14:59:25 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 92341-06 for ; Fri, 31 Mar 2006 14:59:24 -0400 (AST) 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 5AD2911F6775 for ; Fri, 31 Mar 2006 14:59:23 -0400 (AST) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1FPOq1-00032R-93 for pgsql-odbc@postgresql.org; Fri, 31 Mar 2006 20:59:13 +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 ; Fri, 31 Mar 2006 20:59:13 +0200 Received: from Marc.Herbert by 83.145.96.118 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 31 Mar 2006 20:59:13 +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: Fri, 31 Mar 2006 21:02:38 +0200 Lines: 31 Message-ID: References: <442C3452.5020704@online.de> <442C4F10.3090004@tpf.co.jp> <442D5DFB.4080501@online.de> 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:FaGH/M5N1oLHsPbhLt2auJ/aldU= X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=1.353 required=5 tests=[AWL=0.100, RCVD_NUMERIC_HELO=1.253] X-Spam-Score: 1.353 X-Spam-Level: * X-Archive-Number: 200603/238 X-Sequence-Number: 7524 Johann Zuschlag writes: > Hmm..., so Windows XP uses UCS-2 or do be more correct (like Bart > mentioned) UTF-16 (which is nearly the same, except for the > surrogates). It's nearly the same... but that makes a huge difference. The reason why you use fixed-character length encoding in memory is speed. This saves you a lot of time when computing string lengths, look for some characters (isalnum(),...), collating etc. If don't care about all this speed then you better stay in a variable-length encoding like UTF-8 which saves you A LOT of space, especially with small occidental alphabets. I think that by moving from UCS-2 to UTF-16 you lose on BOTH sides [insert some missing benchmarks here] And you can be sure that it brings a lot of bugs: one bug every time some string code has been "forgotten" and not updated, still assuming UCS-2. Anyway those bugs are only for far-away and unknown countries out of the BMP so who cares? :-/ So it really looks like a poor compatibility hack to me (java does it too).