从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);

未完待续……

参考链接:
http://www.qtcentre.org/threads/17481-convert-unsigned-char-*-to-QString

你可能感兴趣的:(C++,Qt,技术问题和解决)