Question

Locked

Decoding a string from UTF8 to ascii

By djlactose ·
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.

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Collapse -

I have tried that code...

by djlactose In reply to So what's the problem?

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

Collapse -

This is the code I am trying...

by djlactose In reply to Decoding a string from UT ...

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

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

Collapse -

Well yes

by Tony Hopkinson In reply to This is the code I am try ...

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?

Related Discussions

Related Forums