diff --git a/lib/PGcore.pm b/lib/PGcore.pm index fc4794fea9..b2f12f80bd 100755 --- a/lib/PGcore.pm +++ b/lib/PGcore.pm @@ -29,6 +29,7 @@ use Tie::IxHash; use WeBWorK::Debug; use MIME::Base64(); use PGUtil(); +use Encode qw(encode_utf8 decode_utf8); ################################## # PGcore object @@ -563,13 +564,15 @@ sub PG_restricted_eval { sub decode_base64 ($) { my $self = shift; my $str = shift; - MIME::Base64::decode_base64($str); + $str = MIME::Base64::decode_base64($str); + decode_utf8($str); } sub encode_base64 ($;$) { my $self = shift; my $str = shift; my $option = shift; + $str = encode_utf8($str); MIME::Base64::encode_base64($str); } diff --git a/lib/Value/String.pm b/lib/Value/String.pm index 438a10f8b0..bf9022f705 100644 --- a/lib/Value/String.pm +++ b/lib/Value/String.pm @@ -72,7 +72,7 @@ sub compare { # # Mark a string to be display verbatim # -sub verb {shift; return "\\verb".chr(0x85).(shift).chr(0x85)} +sub verb {shift; return "\\verb".chr(0x1F).(shift).chr(0x1F)} # # Put normal strings into \text{} and others into \verb diff --git a/lib/WeBWorK/PG/IO.pm b/lib/WeBWorK/PG/IO.pm index 0990606be6..feecdfa0f8 100644 --- a/lib/WeBWorK/PG/IO.pm +++ b/lib/WeBWorK/PG/IO.pm @@ -139,7 +139,7 @@ sub read_whole_file { unless path_is_course_subdir($filePath); local (*INPUT); - open(INPUT, "<$filePath") || die "$0: read_whole_file subroutine:
Can't read file $filePath"; + open(INPUT, "<:utf8", $filePath) || die "$0: read_whole_file subroutine:
Can't read file $filePath"; local($/)=undef; my $string = ; # can't append spaces because this causes trouble with <<'EOF' \nEOF construction close(INPUT);