Okay, also mb_strtolower messed up characters like ÜÄÖ on my tests.
I went through the php strtolower comments and tried various functions.
The one which worked restricts the case conversion just for lower
ASCII characters.
Any others are untouched. Meaning of course that ÄÖÜ will not be
converted to äöü etc.
but there are so many of these characters for different European languages
that it would need special arrays for character translation. A possibility.
Here is the function for lower case ASCII, it is supposed to be fast.:
function strtolower2($s) {
$ln = strlen($s);
$ln1 = $ln -1;
for($i=0; $i < $ln; $i++){
$k = ord(substr($s, $i, 1));
if($k>=65 && $k <= 90){
if($i > 0){
$l1 = substr($s, 0, $i);
}else{
$l1 ='';
}
$l1 = $l1 . chr($k+32);
if($i < $ln1){
$l1 = $l1 . substr($s, $i + 1);
}
$s = $l1;
}
}
return $s;
}
2009/3/18 The Editor <[email protected]>:
> I'd prefer to not use mb_strtolower as it is not enabled on all php
> servers. So far I have avoided all the mb_functions. Can we just leave
> the strtolower out? Perhaps put it in the BOLTutf2url or something?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"BoltWire" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/boltwire?hl=en
-~----------~----~----~----~------~----~------~--~---