Blank screen, character encoding woes, partial solution

Blank screen, character encoding woes, partial solution

by Paul Vaughan -
Number of replies: 2
Hi all. I have searched around the forums for character encoding issues and blank screen issues and haven't found anything which describes my exact situation.

We have some resources bought in from Cheltenham Courseware as well as other providers, which have up to now worked well in Moodle. Since the 1.9.6 upgrade (which may just be coincidence) I have had a number of complaints that 'uploaded html files' don't work in Moodle any more, yet do work from a memory stick, or local drive, or from the root of localhost (Apache). I've verified that claim and it's true.

I have traced the issue back to 'illegal characters' in the html files: loading one of the offending files into KWrite or Kate shows the ?-in-a-diamond icon which I can then replace manually with proper dashes or © & or whatever.

I have two problems:

1) I do not know how far and wide this problem goes. We have close to 1,800 courses and probably hundreds of thousands of files, so I can probably grep for the illegal characters and pre-emptively modify the files before anyone knows there is a problem.

2) I don't appear to be able to use iconv to modify the file automatically. If I follow the advice on this page (http://docs.moodle.org/en/Converting_files_to_UTF-8) which is to do the following:

iconv --verbose -f windows-1252 -t UTF-8 -o output.htm input.htm

...the page will load up correctly but with odd accented characters where the dash was. So it works, but not properly. I have had to guess at the input encoding and have tried a lot of variations and this produces the best results.

All suggestions gratefully received. smile

~Paul.
Average of ratings: -
In reply to Paul Vaughan

Re: Blank screen, character encoding woes, partial solution

by Gary Day -
Hello wink

Pick one example of this issue and check for double spaces in the body text.
If you find a double space tell me if it corresponds with the weird accented Á type character(s).
In reply to Gary Day

Re: Blank screen, character encoding woes, partial solution

by Paul Vaughan -
No, no double spaces.

Firefox's main window as well as Show Source option shows "word - word", but Kate and KWrite show "word ? word" and Gedit shows a long rectangle with what I think is the code for the character.

After processing with iconv (as above) I get "word – word" in Firefox... which is less good, but Kate/KWrite show the dash as I expected.

At least after the edit with iconv the page loads, which is better than a blank screen.