Open is-jlehrer opened 2 years ago
To be more specific, is there no way to read from StreamReader
as bytes?
It depends on how you open
your file, rather than StreamReader
. If you use FileOpener
(functional API as open_files
), you can specify the encoding to b
to open file in bytes.
🐛 Describe the bug
Hi,
When decoding from a file stream in
StreamReader
, torchdata automatically assumes the incoming bytes are UTF-8. However, in the case of alternate encoding's this will error (in my caseUnicodeDecodeError: 'utf-8' codec can't decode byte 0xec in position 3: invalid continuation byte
). How do we change the decoding method to fit the particular data stream?Versions