convert utf8 to utf32 and and vice versa , from utf8 to utf16 and vice versa, using icu library.
sudo apt-get install libicu-dev
for more information : visit http://userguide.icu-project.org/
and icu api http://icu-project.org/apiref/icu4c/index.html