How to convert a string's charset?

I want to convert a string’s charset from GB2312 to UTF-8. How can i do
this?