How to convert char * to PRUnichar *
3 answers
If you have UTF-8 string, you can use NS_ConvertUTF8toUTF16 or CopyUTF8toUTF16. If you have a different encoding you will need to use nsICharsetConverterManager or some other API to convert to something normal: http://mxr.mozilla.org/mozilla-central/source/intl/uconv/idl/nsICharsetConverterManager.idl
The XPCOM chaining manual has a good link to this: https://developer.mozilla.org/En/XPCOM:Strings#Unicode_Conversion_ns CString_vs._nsString
+2
source to share