utf8 case folding questions

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

According to <http://area51.phpbb.com/docs/coding -
guidelines.html#charsets>, "case insensitive comparison of strings is
no longer possible with strtolower or strtoupper as some characters
have multiple lower case or multiple upper case forms depending on
their position in a word."  The article goes on to say that you should
use case folding to make sure you have a case insensitive version of a

Will PHP6 support case folding?  Does mb_convert_case() support this
functionality?  php.net says that it has three modes - MB_CASE_UPPER,
MB_CASE_LOWER, or MB_CASE_TITLE, however, phpBB's utf8_case_fold_nfc()
implementation does not use any mb_* functions in utf_tools.php.

Also, what if one wanted to do a case insensitive search in SQL?  If
strtoupper doens't work it seems like SQL's UPPER() wouldn't work,
either, although maybe x consecutive UPPER()'s would work?

MySQL has the function STRCMP(), which might work depending on how
MySQL determined what was a binary string and what was a UTF8 encoded
string, but that, I suspect, is not cross database compliant.

Any ideas?

Re: utf8 case folding questions

Quoted text here. Click to load it
Because the mbstring package is optional in PHP and they've obviously
coded to avoid problems when its not installed.

Quoted text here. Click to load it

Yes it should - but this is somewhat off topic here. RTFM for more

Quoted text here. Click to load it

No it won't.

Quoted text here. Click to load it

It should be fairly portable if you cast the types correctly, although
ISR that charset conversions are not covered by SQL92.


Site Timeline