codecvt::encoding
测试 Byte,则流的编码有状态依赖项,则在 Byte内。使用的和之间的比率生成的 CharType是否为常数,然后,如果是,该值确定大比例。
int encoding( ) const throw( );
返回值
如果返回值为正数因此值为 Byte 的字符常数次数的需要导致 CharType 字符。
受保护的虚成员函数返回:
(1,如果类型序列 extern_type 编码是状态依赖项。
0,如果编码涉及长度可变序列。
N,如果编码涉及长度只有序列 N.
备注
成员函数返回。do_encoding
示例
// codecvt_encoding.cpp
// compile with: /EHsc
#include <locale>
#include <iostream>
using namespace std;
int main( )
{
locale loc ( "German_Germany" );
int result1 = use_facet<codecvt<char, char, mbstate_t> > ( loc ).encoding ( );
cout << result1 << endl;
result1 = use_facet<codecvt<wchar_t, char, mbstate_t> > ( loc ).encoding( );
cout << result1 << endl;
result1 = use_facet<codecvt<char, wchar_t, mbstate_t> > ( loc ).encoding( );
cout << result1 << endl;
}
要求
页眉: <区域设置>
命名空间: std