Qtリファレンス QTextCodec 新しいページはコチラ
提供: yonewiki
(→概要) |
(→概要) |
||
2行: | 2行: | ||
#include<QTextCodec> | #include<QTextCodec> | ||
− | *<span style = "background:linear-gradient(transparent 75%, #ffbf7f 75%); font-weight:bold; ">QTextCodec::setCodecForLocale(QTextCodec* QTextCodecLocale)</span> | + | *<span style = "background:linear-gradient(transparent 75%, #ffbf7f 75%); font-weight:bold; ">void QTextCodec::setCodecForLocale(QTextCodec* QTextCodecLocale)</span> |
void QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8")); | void QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8")); | ||
こんな感じで、テキストのCodecを定義が出来て、文字コードUnicodeのエンコード方式UTF-8を使うことを定義できます。QTextCodec型のクラスにQTextCodec型の引数を受け取るという形式です。 | こんな感じで、テキストのCodecを定義が出来て、文字コードUnicodeのエンコード方式UTF-8を使うことを定義できます。QTextCodec型のクラスにQTextCodec型の引数を受け取るという形式です。 | ||
− | *<span style = "background:linear-gradient(transparent 75%, #ffbf7f 75%); font-weight:bold; ">QTextCodec::codecForName(const char *name)</span> | + | *<span style = "background:linear-gradient(transparent 75%, #ffbf7f 75%); font-weight:bold; ">QTextCodec* QTextCodec::codecForName(const char* name)</span> |
この一つ前に出てきたQTextCodecクラスのメンバ関数の引数に使うもので、引数には文字コードのエンコード方式を指定します。設定できる値は | この一つ前に出てきたQTextCodecクラスのメンバ関数の引数に使うもので、引数には文字コードのエンコード方式を指定します。設定できる値は |