I'm currently struggling to open up a utf-16 encoded XML file with VBA in Excel.
My current String variable titled EntireFile currently begins like this:
ÿþ<?xml version="1.0" encoding="utf-16"?>
<Test xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
As you can see there are some characters in the beginning that seem off.
I get the String variable by doing:
Open PathToFile For Input As #1
Do Until EOF(1)
Line Input #1, textline
EntireFile = EntireFile & textline
File is formatted with UCS-2 Little Endian according to Notepad++ but a quick search trough the internet revealed that this is the Microsoft equivalent to UTF-16?
I tried the bruteforce method of just removing the first two characters but that leaves me with an empty string.
All of the google results cover saving a XML file without the BOM but thats kind of the opposite of what I'm looking for.
Thanks already for your time