Edit report at https://bugs.php.net/bug.php?id=65544&edit=1

 ID:                 65544
 Updated by:         yohg...@php.net
 Reported by:        ww dot galen at gmail dot com
 Summary:            mb title case conversion-first word in quotation
                     isn't capitalized
 Status:             Verified
 Type:               Bug
 Package:            mbstring related
 PHP Version:        5.4 and later
 Block user comment: N
 Private report:     N

 New Comment:

Question is "is this supposed to work?"
There is " before 'or' and no space before word.

Expected result:
----------------
"Or Else It Doesn't, You Know. The Name Of The Song Is Called 'Haddocks' Eyes.'"

Any comments?


Previous Comments:
------------------------------------------------------------------------
[2013-08-25 09:49:08] yohg...@php.net

verified with PHP-5.5 and master branch

------------------------------------------------------------------------
[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

Reply via email to