You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[QTI] A QTI item declaring a non-UTF-8 encoding is published with garbled text #6283
The item passes validate_qti_item, so nothing flags it.
Errors and logs
None; the publish succeeds.
Expected behavior
The published item's text matches raw_data, whatever encoding its declaration names.
Or the item is rejected at validation.
User-facing consequences
Learners see garbled characters in every non-ASCII word of the item.
Steps to reproduce
In VALID_CHOICE_ITEM (tests/utils/qti/test_validation.py), replace encoding="UTF-8" with encoding="ISO-8859-1" and prefix the prompt text with café .
validate_qti_item(xml).is_valid is True.
Pass it through set_qti_item_language(xml, "fr") and strip_studio_attributes, encode to UTF-8 as _create_native_qti_item does, then parse the bytes with lxml.etree.fromstring.
Claude Code found this while reviewing #6235 and drafted this issue. The reproduction was run against upstream/unstable and the #6235 branch, with the same result on both.
Activity