A while ago, I had to fix some stuff in an application that would write – using a binary mechanism – UTF-8 and UTF-16 strings (part of it
XML in various flavours) *to the same byte stream without converting between the two encodings. Some links that helped me investigate what was wrong, ...
More...