2015-04-06 1 views

Répondre

2

Utilisez u_strFromUTF8

UChar* u_strFromUTF8 ( UChar *  dest, 
int32_t  destCapacity, 
int32_t * pDestLength, 
const char * src, 
int32_t  srcLength, 
UErrorCode * pErrorCode 
)  
Convert a UTF-8 string to UTF-16. 

Si la chaîne d'entrée n'est pas bien formé, le code d'erreur U_INVALID_CHAR_FOUND est définie

http://icu-project.org/apiref/icu4c/ustring_8h.html#a5f9ff224b11166a106d1b3ac26454cd4

+0

Dommage qu'un faible niveau C API doit être utilisé, mais cela devra faire. – rightfold