--- loncom/localize/transliterate.pm 2019/02/26 14:42:22 1.1 +++ loncom/localize/transliterate.pm 2019/03/02 23:08:51 1.2 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Transliteration to ascii # -# $Id: transliterate.pm,v 1.1 2019/02/26 14:42:22 raeburn Exp $ +# $Id: transliterate.pm,v 1.2 2019/03/02 23:08:51 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -60,6 +60,7 @@ use strict; use utf8; use Text::Unidecode qw(unidecode); use Encode qw(decode_utf8 encode_utf8); +use Unicode::Normalize qw(normalize); =pod @@ -90,12 +91,14 @@ language code has an appropriate value. sub fname_to_ascii { my ($fname,$language) = @_; if ($fname =~ /([^\x{00}-\x{7f}])/) { - $fname=&decode_utf8($fname); + $fname = decode_utf8($fname); + $fname = normalize('D',$fname); + $fname = normalize('C',$fname); if ($language eq 'de') { $fname = &german_to_ascii($fname); } $fname = unidecode($fname); - $fname=&encode_utf8($fname); + $fname = encode_utf8($fname); } return $fname; } 500 Internal Server Error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at root@localhost to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.