Turns out I should have just added a simple
ds.decode() as soon as the file was imported. I think.
This will mainly replace the function added into
get_value_kw() and related functions, but will be better in that it is done the once at the start and can cope with sequences with multiple encodings.