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. how to read unicode file

how to read unicode file

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
4 Posts 3 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.
  • Y Offline
    Y Offline
    YaronNir
    wrote on last edited by
    #1

    Hi all, I have the file strings.mc (from the message compiler). i want to read it using CStdioFile class.... performing :

    CStdioFile file(szFile,CFile::modeRead);
    char buff[MAX_PATH];
    do
    {
    file.ReadString(buff,MAX_PATH);
    } while (buff != NULL);

    doesn't work so good..... can any1 help? thanks in advanced Yaron Ask not what your application can do for you, Ask what you can do for your application

    A 1 Reply Last reply
    0
    • Y YaronNir

      Hi all, I have the file strings.mc (from the message compiler). i want to read it using CStdioFile class.... performing :

      CStdioFile file(szFile,CFile::modeRead);
      char buff[MAX_PATH];
      do
      {
      file.ReadString(buff,MAX_PATH);
      } while (buff != NULL);

      doesn't work so good..... can any1 help? thanks in advanced Yaron Ask not what your application can do for you, Ask what you can do for your application

      A Offline
      A Offline
      Anand Paranjpe
      wrote on last edited by
      #2

      Hi, add "_UNICODE" in project/settings/C++/general/Preprocessor definations. CStdioFile file; CString str; while( file.ReadString(str)) { //Do something } if u get any linking error with libraries starting or ending with "u" (e.g. uafxcwd.lib), then u need to install unicode support for VC ide on ur machine. The chosen One :)

      Y 1 Reply Last reply
      0
      • A Anand Paranjpe

        Hi, add "_UNICODE" in project/settings/C++/general/Preprocessor definations. CStdioFile file; CString str; while( file.ReadString(str)) { //Do something } if u get any linking error with libraries starting or ending with "u" (e.g. uafxcwd.lib), then u need to install unicode support for VC ide on ur machine. The chosen One :)

        Y Offline
        Y Offline
        YaronNir
        wrote on last edited by
        #3

        thanks Ask not what your application can do for you, Ask what you can do for your application

        A 1 Reply Last reply
        0
        • Y YaronNir

          thanks Ask not what your application can do for you, Ask what you can do for your application

          A Offline
          A Offline
          Anthony_Yio
          wrote on last edited by
          #4

          You need to take into consideration using TCHAR instead of char cause all the charaters in your program are in two bytes. Sonork 100.41263:Anthony_Yio

          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