Quote:
When using StreamReader to reader a file, the character that cannot be
converted to an encoding will be changed to a replace char ,like '?'.
Is there a way to know what the original char(bytes) is?
Not easy.
|
An idea is to read the file using the encoding (and you get a Unicode
string), then convert back to the original encoding and compare with the
original, at byte level.
But when you do such low level stuff, the ease-of-use of something high-level
like StreamReader is gone.
--
Mihai Nita [Microsoft MVP, Windows - SDK]
http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email