Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75143 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 11613 invoked from network); 30 Jun 2014 12:37:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Jun 2014 12:37:12 -0000 Authentication-Results: pb1.pair.com smtp.mail=krebs.seb@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=krebs.seb@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.175 as permitted sender) X-PHP-List-Original-Sender: krebs.seb@gmail.com X-Host-Fingerprint: 209.85.212.175 mail-wi0-f175.google.com Received: from [209.85.212.175] ([209.85.212.175:41428] helo=mail-wi0-f175.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 91/51-03928-7F951B35 for ; Mon, 30 Jun 2014 08:37:12 -0400 Received: by mail-wi0-f175.google.com with SMTP id r20so5980630wiv.14 for ; Mon, 30 Jun 2014 05:37:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=aCMDDixQ2h3Lyusf9D4/J9Hmrts+IKPbLRLbqnsMvGA=; b=IDp1b90Vi/32jlynDxxZamIbl+c67UW3fFCtbvm7/hZF36ZImRMUGqLsExIXWQGUrZ vowSxTzUiwUi6Rhpox7TeRZyzYdQH3bjinhbb1+ibTXOmfYPFlJ1htsKW/Al0gya+U0k a0U3EmUrJ55hi5ft4wMgVWrnmeLlEx5D000r6bl4UAdYsbvKInVkkWCv5AI7LfiX2yYF 8JzZhhBfDHLGjx5yxx/KwuG1GSrbBF4jC+1OhLGBHIaQX2+6ct4gIL11Aboya5rR51Y2 CAbnxvUza/8vU3rNSeeHTbmNrkI9JjKXRJoOIXxMBuceG1iRrEIE8e7BM0twFiDxYHpP GVhw== X-Received: by 10.194.71.12 with SMTP id q12mr44378082wju.5.1404131829140; Mon, 30 Jun 2014 05:37:09 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.127.195 with HTTP; Mon, 30 Jun 2014 05:36:29 -0700 (PDT) In-Reply-To: References: Date: Mon, 30 Jun 2014 14:36:29 +0200 Message-ID: To: Tjerk Meesters Cc: PHP Internals Content-Type: multipart/alternative; boundary=047d7bd91a14e4d36804fd0ceae0 Subject: Re: [PHP-DEV] Re: ucwords() vs title case From: krebs.seb@gmail.com (Sebastian Krebs) --047d7bd91a14e4d36804fd0ceae0 Content-Type: text/plain; charset=UTF-8 2014-06-30 13:54 GMT+02:00 Tjerk Meesters : > 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 > Actually letting a function "uppercase first (letter)" lowercase all subsequent would be even more unexpected. > 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 > -- github.com/KingCrunch --047d7bd91a14e4d36804fd0ceae0--