CStringT::AnsiToOem

更新 : 2007 年 11 月

CStringT オブジェクト内のすべての文字を ANSI 文字セットから OEM 文字セットに変換します。

void AnsiToOem();

解説

この関数は、_UNICODE が定義されているときは使用できません。

使用例

// OEM character 252 on most IBM-compatible computers in
// Western countries/regions is superscript n, as in 2^n.
// Converting it to the ANSI English charset results in a
// normal character 'n', which is the closest possible
// representation.

CStringT<char, StrTraitATL<char, ChTraitsCRT<char>>> str((WCHAR)252);
str.OemToAnsi();
ASSERT(str[0] == 'n');

// Be aware that in OEM to ANSI conversion the 'n'
// from the previous result cannot be converted back to
// a supsercript n because the system does not know what
// the character's value truly was.
str.AnsiToOem();
ASSERT(str[0] != 252);
ASSERT(str[0] == 'n');   

必要条件

ヘッダー : cstringt.h

参照

参照

CStringT クラス

その他の技術情報

CStringT のメンバ