3 ms·
> it also limits discoverability if `fiancee` now is written as `fiancée` […] Searching for the former does not discover the latter. Let's book this under "fal
by bmn__ 4y ago
> it also limits discoverability if `fiancee` now is written as `fiancée` […] Searching for the former does not discover the latter.
Let's book this under "falsehoods programmers believe about Unicode".
You can try either the code below or simply using your browser's search function for this very page and type in the string `fiancee` and see all variants, accent-marked or not, highlighted as results.
#!/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 fiancée.docx', $_)
for 'fiancée', 'fiancee', 'lettre a ma-Fiancee _DOCX_';
__END__
pos 12 len 7
pos 12 len 7
pos 0 len 24
Pardon me if I butchered the French grammar, I do not speak the language and can't easily verify whether I made a mistake in adapting the code from a year ago. <https://news.ycombinator.com/item?id=30405840 https://news.ycombinator.com/item?id=30405840>
- jraph 4y agoFrench is my main language, "Lettre à ma fiancée" seems fine.
- forgotpwd16 4y agoIt isn't a falsehood but a valid remark regarding most tools. Tried searching "fiancee" in your example on VS Code and failed to find "fiancée". Of course you can consider "e=é" similar to how you can do case-insensitive search considering "e=E". Problem is most tools currently don't do this.