QByteArray QString::toAscii() const

Returns an 8-bit representation of the string as a QByteArray.

文字列を 8 ビットで表した QByteArray を返します。

If a codec has been set using QTextCodec::setCodecForCStrings(), it is used to convert Unicode to 8-bit char; otherwise this function does the same as toLatin1().

コーデックが QTextCodec::setCodecForCStrings() を使ってセットされた場合、それは Unicode から 8 ビット文字への変換に使われます。それ以外、この関数は toLatin1() と同じです。

Note that, despite the name, this function does not necessarily return an US-ASCII (ANSI X3.4-1986) string and its result may not be US-ASCII compatible.

注意してください。名前に反して、この関数は必ず US-ASCII (ANSI X3.4-1986) 文字列を返すとは限らず、その結果は US-ASCII 互換でない場合があります。

See also fromAscii(), toLatin1(), toUtf8(), toLocal8Bit(), and QTextCodec.

参考 fromAscii(), toLatin1(), toUtf8(), toLocal8Bit(), and QTextCodec.

QString Class | Qt 4.8