darcs

Issue 2732 XML-illegal characters in darcs changes are not escaped

Title XML-illegal characters in darcs changes are not escaped
Priority bug Status unknown
Milestone Resolved in
Superseder Nosy List bortzmeyer
Assigned To
Topics

Created on 2024-09-02.11:28:16 by bortzmeyer, last changed 2024-11-11.20:36:09 by bfrk.

Files
File name Uploaded Type Edit Remove
resolve-issue2732_-generate-xml-using-the-xml-package.dpatch bfrk, 2024-11-11.20:33:18 application/darcs-patch
Messages
msg24079 (view) Author: bortzmeyer Date: 2024-09-02.11:28:11
Testing the tool darcs-to-git, it crashes on one repository because:

Illegal character "\b" in raw string "Toujours en DISCUSS a l'IEG\bSG"

This is apparently because it relies on darcs changes --xml and this one does not escape the characters like \b when they are in the commit messages, therefore proudcing illegal XML.
msg24094 (view) Author: bfrk Date: 2024-11-06.08:42:45
I have attached a patch bundle, to be applied to current screened (`darcs 
clone https:/darcs.net/screened`). This should fix your problem. Could 
you please try and see if that works better? If it does, I am willing to 
make a new bug-fix release (2.18.5).
Attachments
msg24097 (view) Author: bortzmeyer Date: 2024-11-11.16:47:58
Sorry, it did not help. Testing the output of 'darcs changes --xml' with xmllint:

/tmp/ch.xml:50015: parser error : xmlParseCharRef: invalid xmlChar value 56548
    <name>P&#56548;s approuve</name>

Indeed, the commit messages were in Latin-1 at the beginning of the repository and are in UTF-8 now. All commit messages with non-ASCII Latin-1 characters experience the above problem.
Suggestion: invalid UTF-8 sequences could be replaced by ??? or something similar. At least, the XML would be legal.
msg24100 (view) Author: bfrk Date: 2024-11-11.20:33:17
I agree. The patch I made did not yet do the correct conversion for all patch metadata.
Please try with newly attached bundle instead.
Note: you should obliterate the two patches from previous bundle and also pull.
Attachments
msg24101 (view) Author: bfrk Date: 2024-11-11.20:36:09
Or apply to a fresh clone.
History
Date User Action Args
2024-09-02 11:28:16bortzmeyercreate
2024-11-06 08:42:47bfrksetfiles: + lower-the-upper-bound-for-http_client_tls.dpatch
messages: + msg24094
2024-11-11 16:47:59bortzmeyersetmessages: + msg24097
2024-11-11 20:33:19bfrksetfiles: + resolve-issue2732_-generate-xml-using-the-xml-package.dpatch
messages: + msg24100
2024-11-11 20:34:38bfrksetfiles: - lower-the-upper-bound-for-http_client_tls.dpatch
2024-11-11 20:36:09bfrksetmessages: + msg24101