Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75140 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 5535 invoked from network); 30 Jun 2014 11:55:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Jun 2014 11:55:02 -0000 Authentication-Results: pb1.pair.com header.from=tjerk.meesters@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=tjerk.meesters@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.176 as permitted sender) X-PHP-List-Original-Sender: tjerk.meesters@gmail.com X-Host-Fingerprint: 209.85.220.176 mail-vc0-f176.google.com Received: from [209.85.220.176] ([209.85.220.176:50189] helo=mail-vc0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 67/20-03928-51051B35 for ; Mon, 30 Jun 2014 07:55:01 -0400 Received: by mail-vc0-f176.google.com with SMTP id ik5so7341593vcb.21 for ; Mon, 30 Jun 2014 04:54:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=tzMLyU3mHmXF25W9sPCuzF9oD20rue3sSsqLXyvCSdc=; b=cKefx9jBagpl6/igTHIzwYc39LBj6kLdlifM31nF1oeXSJEaB/+hTQTLacJkGABNrw 93AaL/0UYzYKF9QHjTD3f/K2mmH64ObTGb3dB03HFHFpV9SzcGA07+f9z/9FTHjdZ2Mg nUsu5t2Mm2kyZxHiRAtzjVnQ+jsZdWQyp5wvUhZ9DDiRDr7rUKkwvvmYMkk1YoLlQXoU MxoXAADNH1NhO8cAFiquL/MDHagQWEJCS6BxnV96T49lUBuZhDKNhAKTCyewljh8k7Iw E/cEqJMvc/0eDAmn+BYlZfuaAHf7c1x4waM5BPvb820I11uD/S/Iv6N21FOz++5hPa9m e//A== MIME-Version: 1.0 X-Received: by 10.58.245.134 with SMTP id xo6mr23654399vec.14.1404129298857; Mon, 30 Jun 2014 04:54:58 -0700 (PDT) Received: by 10.58.132.34 with HTTP; Mon, 30 Jun 2014 04:54:58 -0700 (PDT) Date: Mon, 30 Jun 2014 19:54:58 +0800 Message-ID: To: PHP Internals Content-Type: multipart/alternative; boundary=047d7bd6ad8813c44d04fd0c54b9 Subject: Re: ucwords() vs title case From: tjerk.meesters@gmail.com (Tjerk Meesters) --047d7bd6ad8813c44d04fd0c54b9 Content-Type: text/plain; charset=UTF-8 Hi internals, I came across this old bug: https://bugs.php.net/bug.php?id=34407 The desired behaviour for that particular person: "the (world) now" => "The (World) Now" Currently PHP adopts a very simple rule: 1. Capitalise first character (no matter what it is) 2. Capitalise character preceded by a space, tab, etc. Using string.title() from Python you'd get the expected behaviour; they use: 1. Capitalise first letter of a word 2. Lowercase subsequent letters of a word 3. Non-letters delimit words Personally I find that the latter is too much of a departure from what we currently have; a compromise could be to treat punctuation as a word delimiter. Thoughts? -- -- Tjerk --047d7bd6ad8813c44d04fd0c54b9--