New develop candidate multilingual#390
Conversation
…esn't interfere with utf8
create records in PG->{flags} with settings which will influence the
HTML lang and dir attributes set for the HTML element containing the
problem. This allows proper detection of the language of the problem in
the browser, when it is not the primary course language, and to override
the direction for cases when a LTR problem is being viewed/assigned in a
course in a RTL course, or visa-versa. The flag values set in the problem
are processed in the subroutine output_problem_lang_and_dir() in
webwork2/lib/WeBWorK/ContentGenerator/Problem.pm
if there is no override set in the course configuration.
set flags for the problem language and textdirection which can be accessed inside the webwork2 code to allow using this data to set the HTML lang and dir tags as needed on DIV elements which envelop the problem text.
Develop utf8 ver2
…ction_to_PG_flags Add lang and direction to pg flags
…e Encoding.pm file
Develop unit tests2
…eviewers of multilingual
|
I have removed the unit tests in t/ so that they don't confuse checking utf8. I have also moved updates to tableau.pl and other features to the pull requests #394. All of the remaining files |
|
I ran some tests with this version of PG and a modified version of openwebwork/webwork2#927 which makes changes to use a database using utf8mb4 encoding. Basic testing works fine. See the comments to that PR. |
|
Getting the perl Encode module working in WWSafe sees to be an issue which led to some of the changes in how PG files are read in. This comment is mainly for the history, unless someone is ready to hack at This issue seems to be the reason why some places (in particular the which is considered "less secure" that the alternative which depends on the Encode module: This is a matter for further discussion in the future. The material below is based an email discussion with @mgage:
instead of as was the case in the older This change lets problems which use Based on the error messages (included below), maybe the problem was just that the Perl Encode If so, maybe a better (safer) fix would be to allow use of the Encode module inside the "safe" environment (if that is feasible). I tried to see if I could figure out some method to allow the I tried several things (discussed below) and was not successful. I kept getting either error The only other idea I have to try to get Encode working would be to allow the read_whole_file() to run somehow outside of the WWSafe environment when a PG file is being parsed, so it could use the Encode module without getting Encode to work inside WWSafe.
Having looked at: https://stackoverflow.com/questions/14566460/how-differs-the-open-pragma-with-different-utf8 it seems that Two more links on
Note: The down-side seems to be that the strict However, even
part of part of a In any case, it seems that if we don't want this to later break something, unless we can get Encode working they should also use
this seems to explain why until I looked at a problem using
or in and also tried adding modules to At once time, it seemed to be getting close, but was complaining about In another attempt I tried allowing
Maybe that is an approach to allowing a "read_whole_file()" subroutine access to the Encode module.
The page https://perldoc.perl.org/PerlIO/encoding.html about the PerlIO::encoding module may also be of some help. |
|
this pr has been replaced by pr #402 which addresses the utf8 issues to some degree |
Merge this PR which contains only the utf8 changes before merging PR #386
This is cleaner. It still adds some t/..... unit test files but they can be ignored for now. They won't interfere with anything else for now. We can sanity check the unit test files after we merge #386.