MATLAB: How to convert CP1252 to UTF-8 inside Matlab

MATLABunknown

I'm pulling some text information from Excel spreadsheets into Matlab. Some of the special characters are encoded as CP1252.
How do I convert them into UTF-8 encoded special characters?

Best Answer

as_unicode = native2unicode( uint8(TheVectorOfCP1252), 'CP1252');
as_utf8 = unicode2native( as_unicode, 'UTF-8');
as_utf8 will now be a uint8 array that can be fwrite()
Related Question