1.5 Suppressing Case Differences ¶
GNU diff
can treat capital letters as
equivalent to their small counterparts, so that, for example, it
considers ‘Funky Stuff’, ‘funky STUFF’, and ‘fUNKy
stuFf’ to all be the same. To request this, use the -i or
--ignore-case option.
When ignoring case diff
downcases each character before comparing it.
For example, ‘diff -i’ downcases Greek capital “Δ” to small
“δ” before comparison. Although this works for many cases, it may
have problems in some. For example:
- The German word “Straße” is not treated like “STRASSE” as
many Germans might expect, because the two words downcase to
“straße” and “strasse” respectively.
- The Greek name “Κως” is not treated like “ΚΩΣ”
even though they both end in sigma,
because the latter’s trailing “Σ” (U+03A3 GREEK CAPITAL LETTER SIGMA)
downcases to “σ” (U+03C3 GREEK SMALL LETTER SIGMA) instead
of to “ς” (U+03C2 GREEK SMALL LETTER FINAL SIGMA).
- The ancient Greek phrase “Πάντα ῥεῖ” is not treated like “ΠΆΝΤΑ ῬΕΙ͂”,
as the former’s trailing “ῖ” is the single character U+1FD6 (GREEK
SMALL LETTER IOTA WITH PERISPOMENI) whereas the latter’s trailing
“Ι͂” has two characters, U+0399 (GREEK CAPITAL LETTER IOTA) and
U+0342 (COMBINING GREEK PERISPOMENI).