UTF_16 question
jak
nospam at please.ty
Sat Apr 27 20:50:08 EDT 2024
Stefan Ram ha scritto:
> jak <nospam at please.ty> wrote or quoted:
>> I read it, both with encoding='utf_16_be' and
>> with 'utf_16_le' without errors but in the last case the bytes are
>> inverted.
>
> I think the order of the octets (bytes) is exactly the difference
> between these two encodings, so your observation isn't really
> surprising. The computer can't report an error here since it
> can't infer the correct encoding from the file data. It's like
> that koan: "A bit has the value 1. What does that mean?".
>
Understood. They are just 2 bytes and there is no difference between
them.
Thank you.
More information about the Python-list
mailing list