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(),就是宿主机当前语言类型进行转换。

  

                  

posted @ 2020-03-05 10:46  cogitoergosum  阅读(131)  评论(0编辑  收藏  举报