fprintf and non-ascii symbols

Newbie Member
29Nov2007,00:34   #1
sombrancelha's Avatar
Hello,

I'm trying to print non-ascii symbols on a file, using

fprintf(file_name, "%c", xxx), where xxx is the symbol number

I'm trying to print symbols 176, 177, 178 and 219 from http://en.wikipedia.org/wiki/Code_page_850.

When I use printf only, the result is perfect. When I use fprintf, however, I get a different output. Is there any different thing to be done?

I'm using Dev-cpp and I'm opening files with Window's Notepad, font Lucida Console.

Thanks in advance
Go4Expert Founder
29Nov2007,09:11   #2
shabbir's Avatar
How you are seeing the output of fprintf is not correct. It may be that you file viewer is doing some tricks.
Newbie Member
29Nov2007,16:16   #3
sombrancelha's Avatar
I'm getting this:

Code:
±    ²² ÛÛ
±±±   ² Û 
 ±  °     
  °°°°°°  
    °°  ±±
  ²    ±±±
  ²²²   ±±
Û ²²²²   ±
Û     °°  
Û     °
while it should be showing the following characters:
Code:
░ ▒ ▓ █
Go4Expert Founder
29Nov2007,17:15   #4
shabbir's Avatar
There is wrong somewhere else because the no of characters cannot change between fprintf and printf.
Ambitious contributor
29Nov2007,17:26   #5
Salem's Avatar
Lots more answers here - http://cboard.cprogramming.com/showthread.php?t=96339