Essentially the process it to convert the original string into an array of bytes and the convert the array of bytes back into a string using the encoding you want. To do this you use the Encoding class, there is an example of what you are doing
here[
^] (near the bottom), except that it is taking ASCII and outputting UTF-8. The princple is the same though.
Note that to use this on a stream you will need to buffer, but the process is much simpler as you already have the encoded byte array from the input buffer and the
Encode
method returns a byte array for your output buffer
[Edit]
By looking at the comments (below) it look like the OP is having problems with html encoding. This can be decoded using
this[
^]