1. 程式人生 > >從unsigned char*(含有中文)轉化為QString時出現亂碼的解決方案

從unsigned char*(含有中文)轉化為QString時出現亂碼的解決方案

本文由Markdown語法編輯器編輯完成。

1. 問題提出:

2. 解決方案:

I encode a string using Blowfish algorithm and it saves the encoded string as an unsigned char *,and now I have to convert it to QString, i tried the following and it works fine:
//encodedPass is unsigned char *
QString tmp=QString::fromLocal8Bit((char*)encodedPass);

未完待續……