0

I have a process which reads text from a text file. Overall, it works fine, but in one file, the imported char shows as a triangle with a question mark.

What is this, and what do I do about it?

6
  • Which char is it? The first, or a later one? Commented Sep 6, 2013 at 13:55
  • Look at neoistheone's answer. You probably need to switch to a different encoding. If you provide code, somebody might give concrete hints. Commented Sep 6, 2013 at 14:15
  • I did some code to see the actual character code, and it comes out to 65533 Commented Sep 6, 2013 at 14:51
  • 1
    U+FFFD is the Unicode substitution character. A diamond, not a triangle. The text file is not encoded in utf-8, Encoding.Default is the usual next guess. Commented Sep 6, 2013 at 15:01
  • @Hans Thank you. I did not know it is the Unicode substitution character. The file I am reading is a plan text file. But it came across the wire, and I think the char got corrupted. All the rest can be read just fine. Commented Sep 6, 2013 at 15:17

1 Answer 1

2

You're using the wrong encoding. You probably need to use UTF8 vs. ASCII. Now, I have no idea how to help with your code, well because there is no code in the question, but the encoding is your problem.

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.