WeBWorK's lib/WWSafe.pm is based on $Safe::VERSION = "2.16" and does not allow the use of the Perl Encode module fully inside the processing of PG files. Perl 5.24.1 has $Safe::VERSION = "2.39"; and that version has additional code to enable the Perl Encode module to work better within "Safe". Updating lib/WWSafe.pm will require great care and expertise.
As a result some code of the limitation of lib/WWSafe.pm some parts of PG use <:utf8 instead of the stricter and safer <:encoding(UTF-8).
See the discussions at:
Somewhat related:
Files (in pg):
lib/WeBWorK/PG/IO.pm
read_whole_file reads a file in raw mode and then uses utf8::decode($string);
- we would prefer to read the file using
<:encoding(UTF-8)
- there is a comment about
Safe not letting <:encoding(UTF-8) work
lib/PGloadfiles.pm
compile_file reads a file in raw mode and then uses utf8::decode($string);
- we would prefer to read the file using
<:encoding(UTF-8)
lib/WeBWorK/PG/Translator.pm
- use
binmode(STDOUT, ":utf8")
- and not something like
binmode(":encoding(UTF-8)")
- or
binmode(INPUT,":encoding(UTF-8)");
lib/PGcore.pm
- uses
binmode(STDOUT, ":utf8");
- and not something like
binmode(":encoding(UTF-8)")
WeBWorK's
lib/WWSafe.pmis based on$Safe::VERSION = "2.16"and does not allow the use of the PerlEncodemodule fully inside the processing of PG files. Perl 5.24.1 has$Safe::VERSION = "2.39";and that version has additional code to enable the PerlEncodemodule to work better within "Safe". Updatinglib/WWSafe.pmwill require great care and expertise.As a result some code of the limitation of
lib/WWSafe.pmsome parts of PG use<:utf8instead of the stricter and safer<:encoding(UTF-8).See the discussions at:
Somewhat related:
Files (in pg):
lib/WeBWorK/PG/IO.pmread_whole_filereads a file inrawmode and then usesutf8::decode($string);<:encoding(UTF-8)Safenot letting<:encoding(UTF-8)worklib/PGloadfiles.pmcompile_filereads a file inrawmode and then usesutf8::decode($string);<:encoding(UTF-8)lib/WeBWorK/PG/Translator.pmbinmode(STDOUT, ":utf8")binmode(":encoding(UTF-8)")binmode(INPUT,":encoding(UTF-8)");lib/PGcore.pmbinmode(STDOUT, ":utf8");binmode(":encoding(UTF-8)")