Re: Question about Extended ASCII character set, and fstream
From: B. v Ingen Schenau (bart_at_ingen.ddns.info)
Date: 10/21/04
- Next message: nospam_at_all.com: "Re: Question about Extended ASCII character set, and ofstream"
- Previous message: nospam_at_all.com: "Re: Question about Extended ASCII character set, and fstream"
- In reply to: nospam_at_all.com: "Question about Extended ASCII character set, and fstream"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 21 Oct 2004 19:12:48 +0200
nospam@all.com wrote:
> Hey all,
>
> Quick question...been bugging me for some time, really. I have a
> console app, it does some things, and I want to save an array of text
> to a text file. The text consists of ASCII and extended ascii (codes 0
> to 255).
One problem with Extended ASCII codes is that nobody seems to agree on
which characters must be present in the extended portion of the
character set and what value to use for each extra character.
> I am using ofstream to output, and this is the line doing the
> actual output:
>
> outfile << screenbuffer[i].Char.AsciiChar;
>
> Note that screenbuffer is an array of type 'CHAR_INFO', quick info of
> it here:
>
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/char_info_str.asp
>
> Anyhow, the output, when I open it up in Notepad, shows ASCII
> characters fine, but nothing from the extended set (the extened set
> characters are garbled... into other characters.) When I put some
> extended ASCII chars into notepad (by holding ALT and pressing some
> numbers), they appear ok. When I try to save the file, it tells me I
> need to save in Unicode format.
>
> SOOOO, I cannot figure out how to output to a text file in Unicode
> format from my program. Any ideas?
You can try to write screenbuffer[i].Char.Unicode to a wofstream object.
And as this is essentially specific to your platform, you also might
want to ask for some advice in a group dedicated to your platform.
>
> Thanks in advance!
> Andy
Bart v Ingen Schenau
-- a.c.l.l.c-c++ FAQ: http://www.comeaucomputing.com/learn/faq c.l.c FAQ: http://www.eskimo.com/~scs/C-faq/top.html c.l.c++ FAQ: http://www.parashift.com/c++-faq-lite/
- Next message: nospam_at_all.com: "Re: Question about Extended ASCII character set, and ofstream"
- Previous message: nospam_at_all.com: "Re: Question about Extended ASCII character set, and fstream"
- In reply to: nospam_at_all.com: "Question about Extended ASCII character set, and fstream"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|