KCharsets: add custom US-ASCII QTextCodec as workaround for QTBUG-83081

Friedrich W. H. Kossebau requested to merge work/kossebau/fixedusasciicodec into master

Qt's ICU-based QTextCodec instance handling US-ASCCI is broken (QTBUG-83081) by not reporting when it encounters data it cannot handle. Which screws any conversions done as test, like the use with QTextCodec::canEncode(...) but also code inspecting directly the success of a tried conversion by checking the invalidChars number of the passed QTextCodec::ConverterState instance, like done in KMime::encodeRFC2047String(...)

As long as a fix is not in Qt, it would be good to have a work-around at least for the US-ASCCI charset, as might be used in some occasions within PIM code, at least unit tests can be triggering this codec.

@dfaure @vkrause @mlaurent @kloecker @knauss

Edited by Friedrich W. H. Kossebau

Merge request reports