Cherif Diallo <Ch**********@discussions.microsoft.com> wrote:
Hi I have a trivial question for the experts.
I would lilke to read be able to read a text file that could contain french
characters with accents.
I'm opening the file with the File.openText(...) and
then loop through the file with the Readline function into a string variable.
But everytime a hit a char with an accent I loses it.
You need to specify the correct encoding. File.OpenText reads the text
using a UTF-8 encoding, which is probably not what you want. Use
StreamReader to open the file and read the text using the correct
encoding. What is the encoding of your file?
See
http://www.pobox.com/~skeet/csharp/unicode.html for more
information about encodings.
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too