Skip to content

Commit

Permalink
Addressing #477
Browse files Browse the repository at this point in the history
  • Loading branch information
plk committed Oct 3, 2024
1 parent b065ff5 commit 3a4a8a2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 5 additions & 3 deletions lib/Biber/Internals.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1674,19 +1674,21 @@ sub _namestring {
# The namepart is padded to the longest namepart in the ref
# section as this is the only way to make sorting work
# properly. The padding is spaces as this sorts before all
# glyphs but it also of variable weight and ignorable in
# glyphs but is also of variable weight and ignorable in
# DUCET so we have to set U::C to variable=>'non-ignorable'
# as sorting default so that spaces are non-ignorable
$nps = normalise_string_sort(join('', $npistring->@*), $field);

# pad all nameparts
$nps = sprintf("%-*s", $section->get_np_length("${namepart}-i"), $nps);
# have to NFC for the padding otherwise the glyph length calculations are wrong
$nps = NFD(sprintf("%-*s", $section->get_np_length("${namepart}-i"), NFC($nps)));
}
else {
$nps = normalise_string_sort($npstring, $field);

# pad all nameparts
$nps = sprintf("%-*s", $section->get_np_length($namepart), $nps);
# have to NFC for the padding otherwise the glyph length calculations are wrong
$nps = NFD(sprintf("%-*s", $section->get_np_length($namepart), NFC($nps)));
}
$kps .= $nps;
}
Expand Down
6 changes: 3 additions & 3 deletions t/sorting.t
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ my $lists3 = "IBM\x{10FFFD}";
my $lists4 = "IBM!HP\x{10FFFD}";
my $lists5 = 'IBM!HP!Sun!Sony';
my $dates1 = '1979,1,2000000,1980,4,8,1924,6,7,1924,7,9,1924,0002,5,192,2,3,1979,3,4,79,3,3';
my $edtypeclass1 = 'redactor,Jaffé Philipp ,Loewenfeld Samuel KaltenbrunnerFerdinand Ewald Paul ';
my $prefix1 = 'mm,,Luzzatto Moshe Ḥayyim ,,,Lashon la-Ramḥal: u-vo sheloshah ḥiburim,2000,';
my $diacritic1 = 'mm,,Hasan Alī ,al-Hasan ʿAlī ,Hasan Alī ,Some title,2000,';
my $edtypeclass1 = 'redactor,Jaffé Philipp ,Loewenfeld Samuel KaltenbrunnerFerdinand Ewald Paul ';
my $prefix1 = 'mm,,Luzzatto Moshe Ḥayyim ,,,Lashon la-Ramḥal: u-vo sheloshah ḥiburim,2000,';
my $diacritic1 = 'mm,,Hasan Alī ,al-Hasan ʿAlī ,Hasan Alī ,Some title,2000,';
my $labels = '2005,3,2';
my $sn1 = '';
my $snk1 = 'mm,,John John vonDoe Jr,,,0';
Expand Down

0 comments on commit 3a4a8a2

Please sign in to comment.