rakesh gupta

rakesh gupta

  • NA
  • 23
  • 718

UTF-8 Encoding and Decoding

Jul 9 2015 7:29 AM

As I Searched for " How to Encode the data in utf-8 format" Regarding this I got the best result is following:

UTF8Encoding utf8 = new UTF8Encoding();
String unicodeString = "ABCD";
// Encode the string.
Byte[] encodedBytes = utf8.GetBytes(unicodeString);
// Decode bytes back to string.
String decodedString = utf8.GetString(encodedBytes);

 
But the Problem is when I see the encoded data I found that is not more than ASCII code.
can any one help me to improve my knowledge.
For example as I passed "ABCD " it gets converted into 65,66,67,68.... I think this is not utf-8 
 

Answers (2)