Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Strange characters in text streams

1 view
Skip to first unread message

Frank Buchan

unread,
Mar 4, 2003, 9:19:16 AM3/4/03
to
The application I tend is rather large, and produces a number of (over 800)
documents based on user inputs, producing what are essentially data-aware
templates on the web, which can then be edited, stored for audit procedures,
and then printed at will.

The problem I am experiencing is rather simple, and I have some ideas what
it might be, but I'm not certain how to tackle it effectively.

In some of the documents the stream read from the database contains strange
symbolic characters, often in place of apostrophes, or other punctuation
marks. I am assuming this a is a character-set problem, but any insight if I
am on the right track, or how to confirm or avoid this, would be greatly
appreciated.

The problem seems especially to occur whenever I use a TextReader class of
any flavour to parse the document.

Thanks again for any ideas.


Phil Haack

unread,
Mar 4, 2003, 12:37:55 PM3/4/03
to
This could be a problem with the Character Encoding. By default, when
you get a StreamReader via calling File.OpenText, for example, the
encoding is UTF-8. Same thing occurs when opening a StreamWriter.

Rather than using File.Open, you can create the StreamReader or
StreamWriter directly using the Encoding.Default encoding.

Phil Haack
Mgr, Software Engineering
Solien Technology, Inc.


"Frank Buchan" <future_...@hotmail.com> wrote in message news:<ewjGXkl4...@TK2MSFTNGP12.phx.gbl>...

Frank Buchan

unread,
Mar 4, 2003, 1:58:44 PM3/4/03
to
I will try that. I suspected the same, but didn't want to trust my instincts
against the wisdom of the collective. :)

"Phil Haack" <haa...@yahoo.com> wrote in message
news:498aa162.03030...@posting.google.com...

0 new messages