Thanks,
I begin to understand this. I will update mode2 with the swap.
My code uses two bytes to read UTF16, but UTF16 can also be four bytes (known as "surrogate pairs").
Would this be needed to be added and would checking on '0xD800' be enough to know if the unicode char is a surrogate pair?
Once I know the full logic, I will try to optimize the code. For now, I just want it to work and learn to understand at the same time
