Encoding problem solved in Perl script and unit tests updated