-
-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UTF8 Support #712
UTF8 Support #712
Conversation
… and mess up the database. Note: We do not need decode from thaw because as sequences of bytes nothing changes. (I think.)
I experience a bug with several non ASCII characters in .pg files. They are not rendered anymore correctly. Previously this was working. I experience this problem both with version 2.12 and with this pull request (together with pull request 278 of pg). The following sample problem demonstrates this problem: ` loadMacros( TEXT(beginproblem()); BEGIN_TEXT This is a utf8 test: ä ü ö Ä Ü Ö ß è é ñ TEXT(EV2(<<EOT)); ENDDOCUMENT(); # This should be the last executable line in the problem. |
Thanks for testing this @heiderich. I am not able to reproduce this bug, however. Could you confirm that you are doing two things:
|
Thanks for your recommendations @goehle. I might have forgotten to restart the webserver after checking out these branches and before testing the problems, so I did this now. As for your second remark, I created the .pg files using a text editor and I believe that they are correctly encoded in utf8. Now the problems are rendered correctly, but the following error message is shown on all pages I loaded (including even the login page of a course). On the top of the pages I see
and at the bottom
As far as I can tell it seems that the content is displayed correctly. |
That is caused by an invalid utf8 character in a file that WeBWorK is trying to read. If you add |
That is caused by an invalid character in a file somewhere. If you add https://github.com/openwebwork/webwork2/blob/master/lib/WeBWorK/Utils.pm#L184 restart the server then reload a page you should be able to figure out which file. I tracked some of those down and they tended to come from the copyright character which was included in stuff like VERSION. I can't reproduce it on my end but if you tell me which file its in I can fix it. |
Thanks for the hint. I was able to figure out which file was responsible and your guess was good. The problem was caused by a copyright sign in a course.conf file. I will make a pull request for the corresponding file in the model course. |
…ch/webwork2 into locbug Conflicts: courses.dist/modelCourse/course.conf
I still experience a problem: While the user interface and the problem text is shown correctly, special characters are not shown correctly in the solutions of the problems. The following produces this problem for me. DOCUMENT(); # This should be the first executable line in the problem. loadMacros( TEXT(beginproblem()); BEGIN_TEXT This is a utf8 test: ä ü ö Ä Ü Ö ß è é ñ TEXT(EV2(<<EOT)); SOLUTION(EV3(<<'END_SOLUTION')); ENDDOCUMENT(); # This should be the last executable line in the problem. |
This was an issue with how knowls and pg interacted with their base64 encoding. I have updated the PG pull request with a fix. |
Thanks for the fix. It resolves the problem for me. |
Sometimes I experience the following error: Error messages
Call stack The information below can help locate the source of the problem.
It might be related to what was reported here: http://www.nntp.perl.org/group/perl.perl5.porters/2008/01/msg133694.html and here |
Does this only happen when viewing problems, or on non problem pages? If it only happens when you view problems could you add
to the list of PG modules (e.g. |
… suggested by goehle
Thank you. I only observed it when viewing problems. With this modification (though I used [qw(Encode::Encoding)] instead of [qw(Encode::Encodings)]) I do not observe the error any more. I just created a pull request. |
added [qw(Encode::Encoding)] to ${pg}{modules}) in defaults.config as…
This is just an update for people using this patch early and for future patch notes. As discussed above Latin1 encodings in conf files (e.g. the copyright character) will cause perl warnings. The new course.conf template file fixes this but its likely established servers will have old files lying around. If people install the
|
Thank you for this patch. There's still an issue with utf-characters in the classlist editor. |
I experience problems with non ASCII characters in Subject, Chapter and Section tags in the .pg files and the Taxonomy2 file. Problems first occur when running OPL-update. I partially solved these problems by
For details see my pull request goehle#15 to the repo of @goehle. It seems that the database gets properly populated. However, the library browser would not list problems in subjects/chapters/sections containing special characters (in my case umlauts). |
There seems to be an encoding problem when the string
in lib/WeBWorK/Authen.pm is localized to something containing proper UTF-8 characters. |
This is incorporated into #893 |
This pull requests adds better support for UTF8 characters, from the rendered webpage all the to the database. While it looks simple its got a surprising number of ramifications and will need a lot of testing.
To install: Checkout both this pull request and pull request openwebwork/pg#278
To test:
Check that none of the existing functionality is broken.
Check that you can use the Russian language setting without long character warnings and that it looks correct. (This will test long character utf8 coming from the localization engine).
Check that you can use utf8 in anything that writes or reads from a file. A good string to test with is "á, é, í, ó, ú, ü, ñ, ¿, ¡ 한글 漢字" This will include
Check that you can use "short" utf characters in text fields (like first name, last name, comment, set description, etc...) You can use "á, é, í, ó, ú, ü, ñ" as a test string.
Check that you can use "long" utf characters if you set up your mysql server to support it.
Check that achievements (and other features which use nfreeze) still work. Note: I changed achievements to use a base64 version of freeze and thaw. This will be compatible with older installations, but the functionality should be checked.