Skip to content

Investigate WWSafe.pm vs. Perl's standard Safe.pm - UTF-8 motivation #982

@taniwallach

Description

@taniwallach

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)")

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions