Question Locked

Decoding a string from UTF8 to ascii

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I am trying to decode a string which is utf8 encoded for a windows vb.net project. This is for an API I am writing so I am trying to make the entire function self contained.

5 replies

by djlactose

I reviewed that before, that converts byte to char. I have a string and when I convert the string to byte it gets all messed up. So I am looking for code to convert a utf8 encoded string to a unicode encoded string

by djlactose

This is the code which is not doing the decoding...

DecodeReply += System.Text.Encoding.ASCII.GetString(System.Text.Encoding.UTF8.GetBytes(temparray(i).ToString))

by tony hopkinson

ASCII and UTF8 are only equivalent for characters [0..127] 128-255 are dependant on codepage. So it you have any content where UTF8 which is a unicode in ASCII encoding will end up as a ? (ascii 63).

Is this what's happening?

This discussion is closed to new replies.