Sujet : Re: UTF_16 question
De : ram (at) *nospam* zedat.fu-berlin.de (Stefan Ram)
Groupes : comp.lang.pythonDate : 27. Apr 2024, 21:13:15
Autres entêtes
Organisation : Stefan Ram
Message-ID : <encodings-20240427201155@ram.dialup.fu-berlin.de>
References : 1
jak <
nospam@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?".