Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:47221 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 37670 invoked from network); 13 Mar 2010 14:14:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Mar 2010 14:14:09 -0000 Authentication-Results: pb1.pair.com smtp.mail=mozo@mozo.jp; spf=permerror; sender-id=permerror Authentication-Results: pb1.pair.com header.from=mozo@mozo.jp; sender-id=permerror Received-SPF: error (pb1.pair.com: domain mozo.jp from 209.85.212.42 cause and error) X-PHP-List-Original-Sender: mozo@mozo.jp X-Host-Fingerprint: 209.85.212.42 mail-vw0-f42.google.com Received: from [209.85.212.42] ([209.85.212.42:63659] helo=mail-vw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 50/03-15916-0BD9B9B4 for ; Sat, 13 Mar 2010 09:14:09 -0500 Received: by vws18 with SMTP id 18so190568vws.29 for ; Sat, 13 Mar 2010 06:14:01 -0800 (PST) MIME-Version: 1.0 Received: by 10.220.128.78 with SMTP id j14mr1883607vcs.56.1268489640165; Sat, 13 Mar 2010 06:14:00 -0800 (PST) In-Reply-To: <661d85d51003130107o7cf19012m7ce93f0147c7585a@mail.gmail.com> References: <4B9926E8.4080202@lerdorf.com> <7f3ed2c31003120958w7bd41059o88869669c6f5b0d9@mail.gmail.com> <661d85d51003130107o7cf19012m7ce93f0147c7585a@mail.gmail.com> Date: Sat, 13 Mar 2010 23:13:39 +0900 Message-ID: To: Chen Ze Cc: Derick Rethans , Hannes Magnusson , Rasmus Lerdorf , PHP Developers Mailing List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] PHP 6 From: mozo@mozo.jp (Moriyoshi Koizumi) On Sat, Mar 13, 2010 at 6:07 PM, Chen Ze wrote: > I think unicode should only care for string handling. Formatting > numbers should not be the thing that unicode cares. Unicode is a > standard for text, not for text or number formatting. > > Back to the days we don't have unicode, the number formatting have > already existed. It even exists when computer was not invented. > > That is same for sorting. > > When we think about Unicode, we should think about those really > related to Unicode,like file system. Number formatting and sorting are > other things which intl cares. > > For the unicode, I think we should implement something like: > > $chars=3Dnew mchar($bytes,$bytes_encoding); > echo $chars;//output encoding > foreach ($chars as $char) { > =A0 =A0 =A0echo $char;//output single utf-16/utf-8 char (depends on defau= lt > output encoding) > } > echo $chars->bytes('gbk'); > > $chars->outputEncoding('gbk'); > echo $chars; > > ini_set('mchar_output_encoding','gbk'); > echo $chars; > > ini_set('mchar_filesystem_encoding','gbk'); > echo $chars->filepath(); > I don't totally agree with what is being said here, but I guess we don't have to make Unicode a first-class value. Once operator overloading is supported, Unicode strings can be represented as objects, like Python does although I didn't have a look at past discussion on this topic. Moriyoshi