View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002728 | Scribus | Internal | public | 2005-10-16 16:31 | 2005-11-05 12:47 |
Reporter | Assigned To | ||||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | x86 Linux | OS | Fedora Core | OS Version | 3 |
Product Version | 1.3.2cvs | ||||
Fixed in Version | 1.3.2cvs | ||||
Summary | 0002728: Fix bad encoding handling in FileLoader, ScribusXML's .sla loading | ||||
Description | FileLoader and ScribusXML use the old, unsafe util.cpp:loadText(...) helper function. This function produces a corrupt QString that we then corrupt again in such a way as to end up with a valid utf-8 QString. The original string is corrupt because we shove multibyte utf-8 characters into multiple QString characters. Since QString is a real text string that knows its own encoding, that data appears to be corrupt. A file containing "©" in utf-8 represents that as \xc2\xa9 ; we shove the bytes "\xc2" and "\xa9" into the QString, producing the QString "©" instead of "©" like we intended. This is better explained in the coding style document, and elsewhere on the 'net. This is inefficient - we convert the QString from a byte stream to a corrupt QSTring, then back to a byte string temporarily when converting back to a QString - and unsafe. I've converted FileLoader and ScribusXML to use the new loadRawText() helper in util.cpp that uses a QCString to load the data. This reduces the number of conversions we do on the data and eliminates the two-wrongs-make-a-right bug in the load code. I also changed the file load path for old format docs so they also go through loadRawText(...) instead of being slurped in directly. This solves some issues with Qt mis-detecting the encoding on old documents. Old docs are now always loaded using the local 8-bit encoding. | ||||
Tags | No tags attached. | ||||
Patch | |||||
Date Modified | Username | Field | Change |
---|---|---|---|
2005-10-16 16:31 |
|
New Issue | |
2005-10-16 16:35 |
|
Relationship added | related to 0002215 |
2005-10-16 16:36 |
|
Description Updated | |
2005-10-16 17:44 |
|
Description Updated | |
2005-10-16 18:09 |
|
Status | assigned => resolved |
2005-10-16 18:09 |
|
Fixed in Version | => 1.3.2cvs |
2005-10-16 18:09 |
|
Resolution | open => fixed |
2005-10-16 18:09 |
|
Note Added: 0007117 | |
2005-11-05 12:47 | cbradney | Status | resolved => closed |