Advertisement Jump to content
Sign in to follow this  
GO2k5

fwrite (unicode)

This topic is 4964 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, Ive got a problem with the fwrite function: BYTE lf[] = {0x0D, 0x00, 0x0A, 0x00}; fwrite(lf, 1, 4, file); the problem is that this code writes 0D 00 0D 0A 00 into the file :/ anyway i just want to have a new line in unicode. But something like: swprintf(printbuffer, TEXT("'%s');\n"), buffer[24]); and printing the buffer to file does not work either >.< Everything else that i printed to that file is ok but not that linefeed :/

Share this post


Link to post
Share on other sites
Advertisement
With the file opened in text mode, it automatically translates the newline (0A) to CRLF (0D 0A). Try opening the file in binary mode.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!