[xml] last version libxml2 2.4.23 problem in international "href" and "src" escaping



Sorry for my bad english.

I'm using libxml for apache module in company work. After changing:

htmlAttrDump(xmlBufferPtr buf, xmlDocPtr doc, xmlAttrPtr cur) {
....................................
....................................
if ((xmlStrEqual(cur->name, BAD_CAST "href")) ||
    (xmlStrEqual(cur->name, BAD_CAST "src"))) {
    xmlChar *escaped;
    xmlChar *tmp = value;

    while (IS_BLANK(*tmp)) tmp++;

escaped = xmlURIEscapeStr(tmp, BAD_CAST"@/:=?;#%&");
_______^^^^^^^^^^^^^^^^^^^^^^^^^^^________________
if (escaped != NULL) {
    xmlBufferWriteQuotedString(buf, escaped);
    xmlFree(escaped);
} else {
    xmlBufferWriteQuotedString(buf, value);
}
....................................
....................................

After calling function xmlURIEscapeStr strings from koi8-r stored in UTF-8
throw libiconv dumped like pure UTF-8 sequence without decoding back.

For example:
string transmitted like %EC%E0%EA%E0%F0%EE%ED - 7 letters in koi8-r
becomes %D0%BC%D0%B0%D0%BA%D0%B0%D1%80%D0%BE%D0%BD - 14 letters in utf8

i don't know form which side change this. But previous versions don't do
anything whith "href" and "src" now is more correct.





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]