tallforasmurf / PPQT

A post-processing tool for PGDP written in Python, PyQt4, and Qt
GNU General Public License v3.0
4 stars 2 forks source link

weird save in utf-8 question #106

Closed bibimbop closed 11 years ago

bibimbop commented 11 years ago

When saving a html document, I get the message:

Cannot save to utf-8 encoding
Click OK to save in UTF-8

If I click OK, then the document is properly saved. Happens all the time. I can provide the files if needed.

tallforasmurf commented 11 years ago

Ah, the magic words 'html document' -- this will assist diagnosis

bibimbop commented 11 years ago

My file is there: https://dl.dropbox.com/u/94763902/prostitution4/ppqt-prost4.zip

tallforasmurf commented 11 years ago

Cannot reproduce with that file. I open it, change a comment, cmd-s to save, no problem. Also tried save-as.

I note that the file contains charset=utf-8 so, the document having file suffix .html and being saved, inferTheCodec() in pqMain will scan the first 1K of the document looking for charset= and return its argument, utf-8 (lowercase). In the earlier version, this would have been a mismatch to a literal 'UTF-8' with the silly message resulting. However the commit for issue #103 made that comparison case-insensitive.

I'm not sure if that fix is included in the current (12-12-10) binary, perhaps not. If not, a temporary fix is to to change the file to read charset=UTF-8 and I will put up a new binary version no later than 11 January.