Thread: Problems writing some chars to files with fprintf

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Mar 2006
    Posts
    158

    Writing to files problem, file created is octet-stream and not text

    I'm trying to write to files with fprintf, here are some examples:

    Code:
    FILE *fp;
    
    fp = fopen("teste.txt", "w")
    
    fprintf(fp, "# Author: %s\n", author);
    however, if author, for instance, has some chars like á ò ê or even €, the text file will not be saved correctly. Why?

    Easy to fix? How?
    Last edited by Nazgulled; 04-18-2006 at 05:59 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. reading and writing to files
    By cgod in forum C++ Programming
    Replies: 2
    Last Post: 10-16-2004, 10:00 PM
  2. reading and writing to files in windows
    By Dohojar in forum Windows Programming
    Replies: 8
    Last Post: 06-26-2003, 02:07 AM
  3. Problems openning huge files
    By acoelho74 in forum C Programming
    Replies: 4
    Last Post: 02-11-2003, 07:02 PM
  4. trying to read all asci char's in files
    By brane_sail in forum C++ Programming
    Replies: 1
    Last Post: 09-02-2002, 11:33 AM
  5. Problems with resource files
    By Unregistered in forum C++ Programming
    Replies: 18
    Last Post: 08-31-2001, 08:45 AM