[dev] [commits] Horde branch master updated. 7fb00276bde050f0d815a9a4fcea4d55834defa7
Jan Schneider
jan at horde.org
Mon Apr 20 17:40:19 UTC 2015
Zitat von Michael J Rubinsky <mrubinsk at horde.org>:
> Quoting Jan Schneider <jan at horde.org>:
>
>> commit e7d135f1e9e5d720bc1b369d49909866a323a632
>> Author: Jan Schneider <jan at horde.org>
>> Date: Fri Apr 17 09:26:15 2015 +0200
>>
>> Use Horde_String's locale-independent methods.
>>
>> There are still bundled libraries that use locale-dependent
>> methods, but I
>> won't bother fixing those now. It would be a PITA to keep them
>> patched/updated,
>> and it should rather be fixed upstream anyway.
>>
>> framework/ActiveSync/lib/Horde/ActiveSync.php | 6 +-
>> framework/ActiveSync/lib/Horde/ActiveSync/Device.php | 10 +-
>> framework/ActiveSync/lib/Horde/ActiveSync/Imap/Adapter.php | 12 +-
>> .../ActiveSync/lib/Horde/ActiveSync/Request/ItemOperations.php | 2 +-
>> framework/ActiveSync/lib/Horde/ActiveSync/Request/Search.php | 6 +-
>> framework/ActiveSync/test/Horde/ActiveSync/DeviceTest.php |
>
> Why do we need to use locale-dependent methods on data that is
> guaranteed to be ASCII? I purposely didn't use it on e.g., the
> device id since it will never be 8bit and I thought it would be more
> efficient not to call the extra method.
That's why we need to split Horde_String. It's simply too confusing to
understand when to use which method.
We need to use locale-INdependent methods. The collation functions
like strtolower are locale-dependent, that is, the outcome may depend
on the current locale. Those are NOT using ASCII for string
operations. Those method replacements in Horde_String are to achieve
locale-independent behavior.
There are other methods in Horde_String that do the opposite, because
the related functions (strpos et al) are assuming ASCII encodings, in
contrary. This doesn't really have anything to do with locale, but
with string encodings instead.
--
Jan Schneider
The Horde Project
http://www.horde.org/
https://www.facebook.com/hordeproject
More information about the dev
mailing list