2

I'm fixing code that is using ASCIIEncoding in some places and UTF-8 encoding in other functions.

Since we aren't using the UTF-8 features, all of our unit tests passed, but I want to create a heightened awareness of encodings that produce similar results and may not be fully tested.

I don't want to limit this to just UTF-8 vs ASCII, since I think issue with code that handles ASN.1 fields and other code working with Base64.

So, what are the commonly confused encodings that may result in identical test data?

3
  • is it an XML or varchar in DB table? what type of document and where you use encoding?
    – Yusubov
    Jun 30, 2012 at 18:45
  • @ElYusubov I have many questions that relate to converting this ASN.1 data and updating pre existing code to C# Jun 30, 2012 at 18:50
  • you may need to tag questions in more helpful way, i just tried to clarify. Thx for link though.
    – Yusubov
    Jun 30, 2012 at 18:54

2 Answers 2

3

Windows Codepages and Extended ASCII support are virtually guaranteed to throw you a curveball.

0

For MIME the following headers may produce similar results:

  • Content-type: text/plain; charset=us-ascii (Plain text)
  • Content-type: text/plain; charset=UTF-8 (a superset of ASCII)
  • Content-type: text/plain; charset="ISO-8859-2" (another superset of ASCII)
  • Content-type: text/enriched; charset="windows-1252" (if there are no enriched codes)
2
  • Is latin1 synonymous with ISO-8859-2, or might it be another "superset of ASCII" that could be useful?
    – detly
    Jul 3, 2012 at 3:06
  • Latin1 is ISO-8859-1. Jul 3, 2012 at 14:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.