QByteArray 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.

文字列をローカルの 8 ビットで表した QByteArray を返します。文字列がローカルの 8 ビット符号化でサポートされない文字を含む場合、返されるバイト列は未定義です。

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.

もし、この文字列がそのロケールエンコードできない何れかの文字を含む場合、返されるバイト列は未定義です。これらの文字は出力されなかったり、他の文字で置き換えられたりします。

See also fromLocal8Bit(), toAscii(), toLatin1(), toUtf8(), and QTextCodec.

参考 fromLocal8Bit(), toAscii(), toLatin1(), toUtf8(), and QTextCodec.

QString Class | Qt 4.8