Click here to Skip to main content
15,899,475 members
Articles / Programming Languages / C#

ANSI or UTF8 without BOM: Read Text with the Right Encoding

Rate me:
Please Sign up or sign in to vote.
4.92/5 (9 votes)
19 Apr 2023CPOL2 min read 15K   14  
Build a StreamReader that can differentiate between ANSI and UTF8 regardless of a byte order mark
A StreamReader that can (to a certain degree) detect the encoding of a text file or stream and can especially differentiate between ANSI and UTF8 without byte order mark.

Views

Daily Counts

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
Germany Germany
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions