I have a Qt application that has a bunch of QLineEdit, QTextEdit etc that the user can modify and put any text he likes.
When saving in this application a XML file is written, partly from what the user has put in these fields. Then the XML file is transformed to HTML through saxonb-xslt.
The problem is that currently the user can enter a range of illegal HTML characters (from 128 to 156 on 1 byte) in these fields, so the XML won't be transformed by saxonb (it rejects it because of illegal HTML characters).
The solution I imagined is creating my own QIODevice overloaded class, and modify the writeData method to transform the data back into a QString, iterate on the QChar and remove every QChar on 1 byte between 128 and 156.
Now this should work in theory, but my question is: I can't be the first one to have this problem, so isn't there a way that can be done easily through a Qt class/method for example? I looked for an already made solution but didn't find it.