https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41789
Bug ID: 41789
Summary: EDIFACT messages broken by unidecode
Initiative type: ---
Sponsorship ---
status:
Product: Koha
Version: Main
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P5 - low
Component: Acquisitions
Assignee: [email protected]
Reporter: [email protected]
QA Contact: [email protected]
In EDI.pm EDIFACT messages are built and the result is passed to unidecode.
However, unidecode replace unicode characters with the transliterated ascii
characters which may include characters that have special meaning including
apostrophe '.
my $order_file = $edifact->encode();
# ingest result
if ($order_file) {
my $m = unidecode($order_file); # remove diacritics and non-latin
chars
But this must be done before escaping special characters. For instance:
diff --git a/Koha/Edifact/Order.pm b/Koha/Edifact/Order.pm
index a36bd7e1b5b..096e66d5f3e 100644
--- a/Koha/Edifact/Order.pm
+++ b/Koha/Edifact/Order.pm
@@ -27,6 +27,7 @@ use Readonly qw( Readonly );
use Koha::Database;
use Koha::DateUtils qw( dt_from_string );
use C4::Budgets qw( GetBudget );
+use Text::Unidecode qw( unidecode );
use Koha::Acquisition::Orders;
@@ -685,6 +686,7 @@ sub _interchange_sr_identifier {
sub encode_text {
my $string = shift;
if ($string) {
+ $string = unidecode( $string );
$string =~ s/[?]/??/g;
$string =~ s/'/?'/g;
$string =~ s/:/?:/g;
--
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/