Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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?

share|improve this question
    
is it an XML or varchar in DB table? what type of document and where you use encoding? –  Yusubov Jun 30 '12 at 18:45
    
@ElYusubov I have many questions that relate to converting this ASN.1 data and updating pre existing code to C# –  makerofthings7 Jun 30 '12 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 '12 at 18:54

2 Answers 2

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

share|improve this answer

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)
share|improve this answer
    
Is latin1 synonymous with ISO-8859-2, or might it be another "superset of ASCII" that could be useful? –  detly Jul 3 '12 at 3:06
    
Latin1 is ISO-8859-1. –  Joachim Sauer Jul 3 '12 at 14:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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