Jump to content
  • Advertisement
Sign in to follow this  
GO2k5

fwrite (unicode)

This topic is 4872 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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!