
❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

Target branch: unstable
Observed behavior
raw_data is a str. Validation and publish encode it to UTF-8 bytes (validate_qti_item, _create_native_qti_item in utils/assessment/qti/archive.py).
- If the item's XML declaration names another encoding, e.g.
encoding="ISO-8859-1", the bytes are decoded under that declared encoding.
- So non-ASCII text is mis-decoded:
café reaches Kolibri as café.
- 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.
- The prompt text reads
café Select the correct answer.
Context
Studio unstable at ec6eb522d.
AI usage
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.
❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.
Target branch: unstable
Observed behavior
raw_datais astr. Validation and publish encode it to UTF-8 bytes (validate_qti_item,_create_native_qti_iteminutils/assessment/qti/archive.py).encoding="ISO-8859-1", the bytes are decoded under that declared encoding.caféreaches Kolibri ascafé.validate_qti_item, so nothing flags it.Errors and logs
None; the publish succeeds.
Expected behavior
raw_data, whatever encoding its declaration names.User-facing consequences
Learners see garbled characters in every non-ASCII word of the item.
Steps to reproduce
VALID_CHOICE_ITEM(tests/utils/qti/test_validation.py), replaceencoding="UTF-8"withencoding="ISO-8859-1"and prefix the prompt text withcafé.validate_qti_item(xml).is_validisTrue.set_qti_item_language(xml, "fr")andstrip_studio_attributes, encode to UTF-8 as_create_native_qti_itemdoes, then parse the bytes withlxml.etree.fromstring.café Select the correct answer.Context
Studio
unstableatec6eb522d.AI usage
Claude Code found this while reviewing #6235 and drafted this issue. The reproduction was run against
upstream/unstableand the #6235 branch, with the same result on both.