Thanks for that pg. I've gone with your solution. Thanks also to the other monks for their suggestions. The application that I'm producing the file for expects an exact format/sequence of carriage returns and newlines. The C code that I took the basic ideas from just opened the file in bin mode and then output a null byte after every character to make it look as though it was writing Unicode...