Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/PGcore.pm
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ use Tie::IxHash;
use WeBWorK::Debug;
use MIME::Base64();
use PGUtil();
use Encode qw(encode_utf8 decode_utf8);

##################################
# PGcore object
Expand Down Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Value/String.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/WeBWorK/PG/IO.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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: <BR>Can't read file $filePath";
open(INPUT, "<:utf8", $filePath) || die "$0: read_whole_file subroutine: <BR>Can't read file $filePath";
local($/)=undef;
my $string = <INPUT>; # can't append spaces because this causes trouble with <<'EOF' \nEOF construction
close(INPUT);
Expand Down