#460 closed defect (bug) (fixed)
ucfirst cannot be used in non-english sites
Reported by: | ddmitry | Owned by: | |
---|---|---|---|
Milestone: | Priority: | major | |
Severity: | Version: | ||
Component: | Keywords: | i18n | |
Cc: |
Description
When using localized version where strings in UTF-8 encoding, I have uncorrect representation of first letter. Looked in code and see that problem in ucfirst() function, widely used in /bp-core/bp-core-templatetags.php and others.
Solution can be simple: I have seen on http://ua2.php.net/ucfirst and in comments exist one similar functions worked for me:
function my_mb_ucfirst($str) {
$fc = mb_strtoupper(mb_substr($str, 0, 1));
return $fc.mb_substr($str, 1);
}
Think that ucfirst calls must be replaced with similar function.
thanks.
Change History (3)
Note: See
TracTickets for help on using
tickets.
Thanks, I've now included this as a 'bp_core_ucwords()' function.