How to read file in Unicode format....


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: How to read file in Unicode format....

  1. #1
    Join Date
    Jan 2007
    Posts
    17

    How to read file in Unicode format....

    Hi everybody,

    I have a file which is in unicode encoding form. I want to read that file in unicode form , how can it be possible in C.

    Thank you in advance.
    Regards,
    Chris.

  2. #2
    Join Date
    May 2006
    Posts
    176
    I case of Visual Studio 2005, I think you can specify the Unicode encoding in fopen call:
    Code:
    FILE * f = fopen("c:\\test.txt", "rt, ccs=UNICODE");
    For reading a line try:
    Code:
    wchar_t line[1024];
    fgetws(line, 1024, f);
    I hope this helps.

  3. #3
    Join Date
    Jan 2007
    Posts
    17

    How to read multibyte character?

    Thank you for your reply.

    Actually I want to read printer spool file. I think it is in multibyte format.
    Can anyone specify me how to read? I am not getting correct result while I am reading as a wide character too.

    Regards,
    Chirag.

Similar Threads

  1. Replies: 5
    Last Post: 11-12-2008, 12:35 AM
  2. Read a file and change the format
    By eldosthen in forum C++
    Replies: 2
    Last Post: 10-09-2006, 04:45 AM
  3. Replies: 13
    Last Post: 05-23-2005, 05:22 PM
  4. File uploading / objFile.Write problem
    By Tomer Cagan in forum ASP.NET
    Replies: 1
    Last Post: 07-24-2001, 09:01 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center