Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. fwrite for unicode big endian

fwrite for unicode big endian

Scheduled Pinned Locked Moved C / C++ / MFC
question
4 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Rakesh5
    wrote on last edited by
    #1

    Hi all, I want my .txt file to be saved in unicode big endian encoded one.. i am using fwrite function... but its not writing properly..its showing some junk characters.. Does fwrite function allow us to save in unicode big endian format?? Please let me know for further clarifications.. thanks, rakesh.

    S 1 Reply Last reply
    0
    • R Rakesh5

      Hi all, I want my .txt file to be saved in unicode big endian encoded one.. i am using fwrite function... but its not writing properly..its showing some junk characters.. Does fwrite function allow us to save in unicode big endian format?? Please let me know for further clarifications.. thanks, rakesh.

      S Offline
      S Offline
      Selvam R
      wrote on last edited by
      #2

      Unicode and ANSI file I/O, line by line[^]

      Thanks and Regards, Selvam, http://www.wincpp.com

      R 1 Reply Last reply
      0
      • S Selvam R

        Unicode and ANSI file I/O, line by line[^]

        Thanks and Regards, Selvam, http://www.wincpp.com

        R Offline
        R Offline
        Rakesh5
        wrote on last edited by
        #3

        Hi Selvam, Thanks for your reply.. Can you please enlighten me about the content u referred?? can you please tell me how can we make fwrite to support unicode big endian type.. thanks, rakesh

        S 1 Reply Last reply
        0
        • R Rakesh5

          Hi Selvam, Thanks for your reply.. Can you please enlighten me about the content u referred?? can you please tell me how can we make fwrite to support unicode big endian type.. thanks, rakesh

          S Offline
          S Offline
          Selvam R
          wrote on last edited by
          #4

          Hi, C++ supports Unicode using wchar_t data type. You can allocate size for unicode data type and write Unicode format.

          size_t n = fwrite(s.c_str(), sizeof(wchar_t), s.size(), f);

          more information/example on the following web http://groups.google.com/group/microsoft.public.vc.language/msg/ea6b6462744737d5?pli=1[^] http://cboard.cprogramming.com/c-programming/87932-reading-unicode-file.html[^]

          Thanks and Regards, Selvam, http://www.wincpp.com

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups