Req #75108 [NEW]: mb_convert_case lacks ucfirst() mode
From: chat dot noir at arcor dot de
Operating system:
PHP version: 7.0.22
Package: mbstring related
Bug Type: Feature/Change Request
Bug description:mb_convert_case lacks ucfirst() mode
Description:
------------
Three of four ASCII case conversion functions have equivalent modes of
mb_convert_case():
1. strtoupper -> MB_CASE_UPPER
2. strtolower -> MB_CASE_LOWER
3. ucwords -> MB_CASE_TITLE
4. ucfirst -> ???
What's with the fourth? Would come in handy when you use some dynamic
text at the beginning of a sentence.
Test script:
---------------
/* example by info at yasarnet dot com */
function capitalize($str, $encoding = 'UTF-8') {
return mb_strtoupper(mb_substr($str, 0, 1, $encoding), $encoding) .
mb_strtolower(mb_substr($str, 1, mb_strlen($str), $encoding),
$encoding);
}
--
Edit bug report at https://bugs.php.net/bug.php?id=75108&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=75108&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=75108&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=75108&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=75108&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=75108&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=75108&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=75108&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=75108&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=75108&r=support
Expected behavior: https://bugs.php.net/fix.php?id=75108&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=75108&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=75108&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=75108&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75108&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=75108&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=75108&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=75108&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=75108&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=75108&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=75108&r=mysqlcfg
Thread (2 messages)
- chat dot noir at arcor dot de