6.0.0-beta6
▾
Tasks
New Task
Search
Photos
Wiki
▾
Tickets
New Ticket
Search
dev.horde.org
Toggle Alerts Log
Help
4/10/26
H
istory
A
ttachments
C
omment
W
atch
Download
Comment on [#9617] db_migrate and incorrect charset handling
*
Your Email Address
*
Spam protection
Enter the letters below:
. .. ,. . ..__. |_/ \./ | |\ || | | \ | |___| \||__|
Comment
>>>> PHP's manual suggest that one should not assume that >>>> strtolower()/strtoupper() work correctly with >>>> multibyte charset like utf-8. >>> >>> Where does it say that? I don't see any such suggestions in the man pages. >> >> It does not it say it in so many words or at least says it >> ambiguously: "Note that 'alphabetic' is determined by the current >> locale" > > Which is exactly what we want. > >> But if we look at php's source code for strtoupper() it works by >> bytes, therefore it will not work correctly with UTF-8 encoded >> strings that contain non ascii characters. > > So the manual is plain wrong. > >> Excerpt from ext/standard/string.c: >> char *php_strtoupper(char *s, size_t len) >> { >> unsigned char *c, *e; >> >> c = (unsigned char *)s; >> e = (unsigned char *)c+len; >> >> while (c < e) { >> *c = toupper(*c); >> c++; >> } >> return s; >> } >> >> The non ascii characters in UTF-8 are multi byte. Therefore using >> php's strtoupper()/strtolower() will not work correctly with UTF-8 >> encoded strings with non ascii characters. > > Thanks for tracking this down so deep.
Attachment
Watch this ticket
N
ew Ticket
M
y Tickets
S
earch
Q
uery Builder
R
eports
Saved Queries
Open Bugs
Bugs waiting for Feedback
Open Bugs in Releases
Open Enhancements
Enhancements waiting for Feedback
Bugs with Patches
Enhancements with Patches
Release Showstoppers
Stalled Tickets
New Tickets
Horde 5 Showstoppers