3 ms·
Software written in the way you suggest will fail in the real world, where, to beat a dead horse, "sœur" indisputably does contain the letter "o." You seem to
by torstenvl 5y ago
Software written in the way you suggest will fail in the real world, where, to beat a dead horse, "sœur" indisputably does contain the letter "o."
You seem to be arguing that the way Unicode treats language is the Right Answer, but that simply isn't the case. Real people speaking real human languages in the real world do not care whether the œ ligature is implemented in a character set or in the font or even what those terms mean. What they do care about is that they searched for "Lettre à ma sœur.docx" and your software failed to show them "Lettre à ma soeur.docx"
I choose not to write software that way. The right thing to do when dealing with human language depends on context, which is ambiguous. Unicode is a just a tool - indeed, one that might be helpful in the case of some ligatures by using NFKD - and nothing more. It certainly isn't an arbiter of what constitutes a character in a human language.
Have a great night.
- bmn__ 5y ago#!/usr/bin/env perl use utf8; use Unicode::Collate; my $uc = Unicode::Collate->new( normalization => undef, level => 1 ); printf "pos %d len %d\n", $uc->index('Lettre à ma sœur.docx', $_) for 'sœur', 'soeur', 'lettre a ma-soeur _DOCX_'; __END__ pos 12 len 4 pos 12 len 4 pos 0 len 21 You have been wrong three times in a row now, just because you have an insufficient understanding of the standard. Time to do what I said in the beginning and read it, or do you want to continue arguing against straw-men and pretending to be knowledgeable enough about the subject matter to talk about it authoritatively?