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. w*fstream troubles

w*fstream troubles

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
1 Posts 1 Posters 0 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.
  • S Offline
    S Offline
    Someone2002
    wrote on last edited by
    #1

    Why w*fstream classes converts unicode characters to single byte before storing? As it well known, Standard Template Library has wstring type, which operates with the unicode characters. Also there is the corresponding steams types, such as for example wofstream. When I use the code below, resulting text file contains single byte characters (ASCII), i.e. the stream converts string from multibyte presentation to single byte. Why? I am absolutely sure that wstring contains natural unicode symbols. std::wofstream outfile ("somefile.txt") ; std::wstring str1 = L"Some string" ; //L translates char to wide char (MSVC) outfile << str1 ; outfile.close() ;

    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