Victor
Victor

Reputation: 372

How does ASCII 0x00A0 becomes 0x00E1

I'm reverse engineering a old parser application and the ASCII code 00A0 ("NO-BREAK SPACE") from a text file, is being parsed into 00E1 ("LATIN SMALL LETTER A WITH ACUTE").

What kind of encoding or coercion is happening, and how can I reproduce this behavior in C# ?

Upvotes: 0

Views: 199

Answers (1)

Nicholas Carey
Nicholas Carey

Reputation: 74345

That looks like the CP 850 (DOS) encoding: https://en.wikipedia.org/wiki/Code_page_850

You can get an encoding for that code page via Encoding.GetEncoding(850).

See https://learn.microsoft.com/en-us/dotnet/api/system.text.encoding?view=net-5.0

Bear in mind that there are multiple, similar code pages that vary slightly. Because... standards.

Upvotes: 2

Related Questions