Apache OpenOffice (AOO) Bugzilla – Issue 114600
assertion: bad pCharClass
Last modified: 2017-05-20 09:14:01 UTC
To raise the assertion ... (*) Open a new Writer document. (*) Type two lines, "first line" and "second line". (*) Save the document. (*) Type ctrl-A to select the entire contents. Program hightlights the selection. (*) Type ctrl-X to delete the entire contents. Program presents Debug Output ... Error: bad pCharClass From File /home/terry/OOo_hacking/DEV300_m87/sal/rtl/source/uri.cxx at Line 604 Abort ? (Yes=abort / No=ignore / Cancel=core dump) I am running a non-product build of DEV300_m87.
Apparently a regression introduced with the fix for issue 106861. <http://hg.services.openoffice.org/cws/sw321bf01/rev/02b1fd6f2c08> uses rtl::Uri::encode to encode a MIME parameter value in a broken way. For one, the calling code claims that '%' need not be encoded, which can never be true for URI syntax (hence the failed assertion). And for another, the calling code also claims that '"' need not be encoded, which clearly conflicts with the clients' use of quoted-string to encode the MIME parameter value. Additionally, it looks odd to put a protocol of URI-style--encoding a parameter value on top of MIME instead of using RFC 2184 conventions directly.
*** Issue 115522 has been marked as a duplicate of this issue. ***
Indeed, it was a quick showstopper fix for the problem. Any available encoding way that would be accepted by mimetype format was better than the situation there. So it was indeed a misuse of the URI encoding to get a simple and fast solution.
So we can fix this by encoding the following characters in transfer.cxx % " \ ' Adding a new function that implements RFC 2184 is out of scope for 3.4, IMHO.
svl/inettype.hxx and tools/inetmime.hxx deal with MIME type representations, but seem to not offer exactly what would be needed here (e.g., INetContentTypes::appendUSASCIIParameter only works for ASCII values). @mba: Why include ' in the list of encoded characters?
Thanks for the heads-up, adding ' that was a mistake.