C#, UTF-8 and encoding characters

Posted by AspNyc on Stack Overflow See other posts from Stack Overflow or by AspNyc
Published on 2011-01-28T23:36:32Z Indexed on 2011/01/29 7:26 UTC
Read the original article Hit count: 317

This is a shot-in-the-dark, and I apologize in advance if this question sounds like the ramblings of a madman.

As part of an integration with a third party, I need to UTF8-encode some string info using C# so I can send it to the target server via multipart form. The problem is that they are rejecting some of my submissions, probably because I'm not encoding their contents correctly.

Right now, I'm trying to figure out how a dash or hyphen -- I can't tell which it is just by looking at it -- is received or interpreted by the target server as ?~@~S (yes, that's a 5-character string and is not your browser glitching out). And unfortunately I don't have a thorough enough understanding of Encoding.UTF8.GetBytes() to know how to use the byte array to begin identifying where the problem might lie.

If anybody can provide any tips or advice, I would greatly appreciate it. So far my only friend has been MSDN, and not much of one at that.

© Stack Overflow or respective owner

Related posts about c#

Related posts about encoding