Bug #65544 [Opn->Ver]: mb title case conversion-first word in quotation isn't capitalized
| From: | yohgaki@php.net | Date: | Sun, 25 Aug 2013 09:49:08 +0000 |
| Subject: | Bug #65544 [Opn->Ver]: mb title case conversion-first word in quotation isn't capitalized | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-181177@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=65544&edit=1
ID: 65544
Updated by: yohgaki@php.net
Reported by: ww dot galen at gmail dot com
Summary: mb title case conversion-first word in quotation
isn't capitalized
-Status: Open
+Status: Verified
Type: Bug
Package: mbstring related
-PHP Version: 5.4.19
+PHP Version: 5.4 and later
Block user comment: N
Private report: N
New Comment:
verified with PHP-5.5 and master branch
Previous Comments:
------------------------------------------------------------------------
[2013-08-25 01:25:22] ww dot galen at gmail dot com
Description:
------------
When
mb_convert_case() is used in MB_CASE_TITLE mode, the first letter character in a
quotation immediately
following the quotation mark isn't uppercased.
According to the Unicode 4 standard, § 3.13, when title-casing a string the first *cased
character* in a word is
supposed to be converted to title case. In the PHP implementation
(php_unicode_convert_case() in
php_unicode.c), the first *character* is converted to title case. Coupled with the fix for #46626
(which makes
characters in "Punctuation, Other" word characters), quotation marks are converted to
title case, rather than
the first letter following.
Tested with PHP 5.4, but the same code is present in every version of PHP since 5.2.7 (including
5.5) as well.
Test script:
---------------
<?php
echo mb_convert_case("\"or else it doesn't, you know. the name of the song is called
'haddocks' eyes.'\"\n", MB_CASE_TITLE);
Expected result:
----------------
"Or Else It Doesn't, You Know. The Name Of The Song Is Called 'Haddocks'
Eyes.'"
Actual result:
--------------
"or Else It Doesn't, You Know. The Name Of The Song Is Called 'haddocks'
Eyes.'"
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=65544&edit=1