@@ -, +, @@ sensitive) - "foobar" and "Foobar" will be in two separate rows/columns - "Etudiant" and "Étudiant" (french) will be in two separate rows/columns too --- reports/issues_stats.pl | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) --- reports/issues_stats.pl +++ reports/issues_stats.pl @@ -23,7 +23,6 @@ use warnings; use CGI; use Date::Manip; -use Text::Unaccent; use C4::Auth; use C4::Debug; @@ -343,7 +342,7 @@ sub calculate { $linefilter[0] =~ s/\*/%/g; $strsth .= " AND $line LIKE ? "; } - $strsth .= " group by $linefield order by $lineorder "; + $strsth .= " group by $linefield collate utf8_bin order by $lineorder "; $debug and warn $strsth; push @loopfilter, { crit => 'SQL =', sql => 1, filter => $strsth }; my $sth = $dbh->prepare($strsth); @@ -432,7 +431,7 @@ sub calculate { $strsth2 .= " AND $column LIKE ? " ; } - $strsth2 .= " group by $colfield order by $colorder "; + $strsth2 .= " group by $colfield collate utf8_bin order by $colorder "; $debug and warn $strsth2; push @loopfilter, { crit => 'SQL =', sql => 1, filter => $strsth2 }; my $sth2 = $dbh->prepare($strsth2); @@ -561,6 +560,7 @@ sub calculate { } else { $strcalc .= " $colfield "; } + $strcalc .= " collate utf8_bin "; $strcalc .= " ORDER BY "; if($line_attribute_type) { @@ -647,24 +647,24 @@ sub null_to_zzempty { sub table_set { my ($table, $row, $col, $val) = @_; - $row = lc(unac_string('utf-8', $row // '')); - $col = lc(unac_string('utf-8', $col // '')); + $row = $row // ''; + $col = $col // ''; $table->{ null_to_zzempty($row) }->{ null_to_zzempty($col) } = $val; } sub table_get { my ($table, $row, $col) = @_; - $row = lc(unac_string('utf-8', $row // '')); - $col = lc(unac_string('utf-8', $col // '')); + $row = $row // ''; + $col = $col // ''; return $table->{ null_to_zzempty($row) }->{ null_to_zzempty($col) }; } sub table_inc { my ($table, $row, $col, $inc) = @_; - $row = lc(unac_string('utf-8', $row // '')); - $col = lc(unac_string('utf-8', $col // '')); + $row = $row // ''; + $col = $col // ''; $table->{ null_to_zzempty($row) }->{ null_to_zzempty($col) } += $inc; } --