<i18n dev> RFR: 8302871: Speed up StringLatin1.regionMatchesCI [v7]
Martin Buchholz
martin at openjdk.org
Wed Feb 22 00:48:33 UTC 2023
On Wed, 22 Feb 2023 00:06:51 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> Thanks Martin, I will from now on envision a stack of dusty punch cards with carefully scribbled notes on the back, barely held together with a dry and cracked rubber band.
>>
>> More to the point: Do you have an opinion on the appropriate level of documentation / comments for this kind of 'tricky' code? My goal is that future maintainers should not get scared by the code and help them understand why it became what it is.
>
> There are still some books on this :) but from wikipedia:
>> during May 1963 the CCITT Working Party on the New Telegraph Alphabet proposed to assign lowercase characters to sticks[[a]](https://en.wikipedia.org/wiki/ASCII#cite_note-NB_Stick-15)[[14]](https://en.wikipedia.org/wiki/ASCII#cite_note-Bemer_1980_Inside-14) 6 and 7,[[15]](https://en.wikipedia.org/wiki/ASCII#cite_note-CCITT_1963-16) and [International Organization for Standardization](https://en.wikipedia.org/wiki/International_Organization_for_Standardization) TC 97 SC 2 voted during October to incorporate the change into its draft standard.[[16]](https://en.wikipedia.org/wiki/ASCII#cite_note-ISO_1963-17) The X3.2.4 task group voted its approval for the change to ASCII at its May 1963 meeting.[[17]](https://en.wikipedia.org/wiki/ASCII#cite_note-18) **Locating the lowercase letters in sticks[[a]](https://en.wikipedia.org/wiki/ASCII#cite_note-NB_Stick-15)[[14]](https://en.wikipedia.org/wiki/ASCII#cite_note-Bemer_1980_Inside-14) 6 and 7 caused the characters to differ in bit pattern
from the upper case by a single bit, which simplified [case-insensitive](https://en.wikipedia.org/wiki/Case-insensitive) character matching and the construction of keyboards and printers.**
>
> Hence the simplicity of the shift key :)
More history: IIRC I originally used 'ASCII trick' when I was truly only cared about ASCII, not Latin1 (e.g. ZipFile.isMetaName) and it's a slight misnomer to use "ASCII" here. But Latin1 followed the precedent of ASCII.
-------------
PR: https://git.openjdk.org/jdk/pull/12632
More information about the i18n-dev
mailing list