#979864 stepic: Stepic incorrectly handles non-latin texts and binary data

Package:
stepic
Source:
stepic
Submitter:
Victor Wagner
Date:
2021-01-12 06:03:03 UTC
Severity:
normal
Tags:
#979864#5
Date:
2021-01-12 05:54:03 UTC
From:
To:
Dear Maintainer,

I've tried to use stepic command line script
to hide some Cyrillic text in UTF-8 inside a PNG image,
and found out that if stepic correctly encodes it (and this text is decoded
by older Python2 based version of Stepic from ubuntu xenial),
it fails to decode non-ascii text.

It seems that stepic interprets bytes extracted from image as ISO8859-1
text and converts them to utf-8 before outputing to stdout or writing to
output file.

Moreover, it does so regardless of current locale settings.

i have to "convert" stepic output "from utf-8" "to iso8859-1" with iconv
to get correct UTF-8 text.

I think that at least when writing output to file stepic should
write bytes extactly as they were extracted from image for they might
be some binary data such as encrypted text.

It is better to not do any encoding conversion event when writing to
stdout.