Why is it called case "folding"?
Ken Whistler
kenwhistler at sonic.net
Thu Mar 17 14:07:43 CDT 2022
Roger,
"Folding" is essentially a mapping operation which is designed to reduce
the number of elements in some systematic way. In Unicode, "case
folding" is a mapping operation which is specified to map uppercase
letters to their corresponding lowercase letters (with various
exceptions all spelled out in detail in the actual mapping table that
specifies the folding). When you apply this "folding" to a set of
strings, you then end up with strings that can be compared without case
differences for individual letters mattering.
You'll find "folding" mentioned in many other contexts in IT processing.
For example, HTML parsers do whitespace "folding", which maps down any
number of adjoining spaces and/or tabs (and line breaks) into a single
space, so that arbitrary differences in the spacing and breaking of
lines in the HTML source doesn't result in differences in the formatted
output for display.
You can find lots of examples of "mapping" and "folding" (as special
cases of the more generic sense of "function") in computer science
literature.
--Ken
On 3/17/2022 11:18 AM, Roger L Costello via Unicode wrote:
> Hi Folks,
>
> I read [1] that this is what case folding is:
>
> Case folding is the process of making two texts which differ only in case identical for comparison purposes, that is, it is meant for the purpose of string matching.
>
> I understand the use of the word "case," as in uppercase and lowercase.
>
> I don't understand the use of the word "folding." Folding? Huh? I fold my towel. I fold my shirt. I don't fold my case (whatever that means).
>
> Why is it called case "folding"? Who came up with that term?
>
> /Roger
>
> [1] https://www.w3.org/TR/charmod-norm/#definitionCaseFolding
>
More information about the Unicode
mailing list