A friend of mine who is a lot more of a coder than I am pointed out that the Windows memory buffer is UTF-16, which makes it sound like there might a conversion (to UTF-8) during write that fails (silently?) when extended characters are encountered.