if you want to write a wide character out you should use a wide stream. it appears that the "ý" prints because its actually the size of a char. casting it to a char defeats the purpose. i dont know what type of stream outfile is, but you may want to try with that, making it a wide stream object.
thats only a guess though, im not too familiar with using hex or unicode.
so maybe it would look like this:
outfile << 0x00FD << 0x039E;
i guess just by coincidence the "ý" fits into a char. i hope this helps. but like i said, im not too familiar with the subject.
good luck.