If anyone else has a similar issue, what I found worked for me is either
or
There maybe some fiddly workarounds possible with setting global TextEncoders and TextDecoders that I've seen suggested but this didn't work for me.