First, the following is a guess-work since i have not tried it. But based on circumstantial evidence, i suspect Roku won't be able to handle UTF-16 text string at all. I expect
ifUrlTransfer.GetToString() will work only in the sense it will download UTF-16 resource but will return string that is truncated. OTOH,
ifUrlTransfer.GetToFile() will likely store the data correct to file but then when you try using
ReadAsciiFile(), result will be same junk.
Why? A character is encoded in two bytes in UTF-16, so say a "<" = chr(60) character will be represented as either \x00 \x3c or \x3c \x00, depending on byte order. In C (in which Roku software is written) however, \x00 is used traditionally as end-of-string marker. This explains why you see only one "<" as contents - it must be that transfer was done in
UTF-16LE.
What to do? Simple - always use UTF-8 encoding, it is universally used and much more compatible.