Re: Code pages
From: Armin Zingler (az.nospam_at_freenet.de)
Date: 05/10/04
- Next message: Cor Ligthert: "Re: get index of combobox (compare text)"
- Previous message: Frank Maxey: "Re: Problem with DialogResult property"
- In reply to: J M: "Code pages"
- Next in thread: J M: "Re: Code pages"
- Reply: J M: "Re: Code pages"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 10 May 2004 12:55:55 +0200
"J M" <a@b.com> schrieb
> Hi,
>
> I'm working on a program that writes data to a DOS-file (a file that
> is to be read by a DOS-program), thus using codepage 437.
> When writing to a binary file there was no problem at all, I just
> used GetEncoder(437) to write the byte arrays to the file.
> But I also have to write to a sequential file. WriteLine doesn't
> support byte arrays.
> I ended up first encoding the strings to byte arrays, writing them to
> a binary file, opening that binary file as a sequential file, reading
> the byte arrays as strings again and then writing the records
> (containing a.o. those strings) back to the sequential file I finally
> needed.
>
> I hate this method. It takes way to long (I'm talking about over
> 20000 records)!
>
> Is there any way that I can convert the unicode strings directly to
> codepage 437 and writing them to a sequential file????
Maybe I'm overlooking the problem, but when creating the Streamrwriter, you
can pass the Encoding object that you created before.
-- Armin How to quote and why: http://www.plig.net/nnq/nquote.html http://www.netmeister.org/news/learn2quote.html
- Next message: Cor Ligthert: "Re: get index of combobox (compare text)"
- Previous message: Frank Maxey: "Re: Problem with DialogResult property"
- In reply to: J M: "Code pages"
- Next in thread: J M: "Re: Code pages"
- Reply: J M: "Re: Code pages"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|