01.07.2016, 17:04
PHP код:
ToLowerExtended(string[], len = sizeof string)
{
for(new i; i < len; i++)
{
// basic Latin
if('A' <= string[i] <= 'Z')
{
string[i] += 0x0020;
continue;
}
// Latin-1 Supplement
if((0x00C0 <= string[i] <= 0x00DE) && string[i] != 0x00D7) // 00D7 is multiplication symbol
{
string[i] += 0x0020;
continue;
}
// Latin Extended-A
if((0x0100 <= string[i] <= 0x017F) && !(string[i] & 1)) // even numbers are uppercase
{
string[i] += 0x0001;
continue;
}
}
}