3

I'm reading a text file with UTF-8 encoding. Some lines of file includes accents. Something like this: EdiçÃo. But on Console and LINQPad output Edi��o instead of.

Here's how to I'm reading the file:

File.ReadAllLines("foo.txt", Encoding.UTF8); 

How to fix this?

1 Answer 1

8

I can't say what the problem is with LINQPad, but the console is probably set to a different code page and doesn't have those characters in its font. See Unicode characters in Windows command line - how?

Sign up to request clarification or add additional context in comments.

1 Comment

This. It is most likely simply a case of the font you are using not having the characters you wish to display. To verify, run your application in debug and put a breakpoint after you read the file. If the byte values are all correct, you're all set. Just change your output font.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.