qt QString

 

类型转换:

     1、QString::toLocal8Bit() const , 查看原文介绍:

                

Returns the local 8-bit representation of the string as a QByteArray. The returned byte array is undefined if the string contains characters not supported by the local 8-bit encoding.
QTextCodec::codecForLocale() is used to perform the conversion from Unicode. If the locale encoding could not be determined, this function does the same as toLatin1().
If this string contains any characters that cannot be encoded in the locale, the returned byte array is undefined. Those characters may be suppressed or replaced by another.

转换为char(8字节)的, 转换的依据是根据QTextCodec::codecForLocale(),就是宿主机当前语言类型进行转换。

  

                  

上一篇:[工作日志2020.3.31]linux系统中文乱码字符集问题


下一篇:Linux常用命令使用格式