⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 decodecharset.cpp

📁 hl2 source code. Do not use it illegal.
💻 CPP
字号:
/*----------------------------------------------------------------------
Copyright (c) 1998,1999 Gipsysoft. All Rights Reserved.
Please see the file "licence.txt" for licencing details.
File:	DecodeCharset.cpp
Owner:	russf@gipsysoft.com
Purpose:	<Description of module>.
----------------------------------------------------------------------*/
#include "stdafx.h"
#include <DebugHlp.h>
#include <Winhelper.h>
#include "QHTM_Types.h"
#include "smallstringhash.h"
#include "StaticString.h"

extern BYTE DecodeCharset( const CStaticString &strCharSet );

struct StructCharSet
{
	LPCTSTR m_pcszName;
	BYTE m_cCharSet;
};

static const StructCharSet g_arrCharSet[] =
{
	{ _T("windows-1250"), EASTEUROPE_CHARSET },
	{ _T("windows-1251"), RUSSIAN_CHARSET },
	{ _T("windows-1252"), ANSI_CHARSET },
	{ _T("windows-1253"), GREEK_CHARSET },
	{ _T("windows-1254"), TURKISH_CHARSET },
	{ _T("windows-1255"), HEBREW_CHARSET },
	{ _T("windows-1256"), ARABIC_CHARSET },
	{ _T("windows-1257"), BALTIC_CHARSET },
	{ _T("gb2312"), GB2312_CHARSET },
	{ _T("windows-OEM"),	OEM_CHARSET }
	
};


BYTE DecodeCharset( const CStaticString &strCharSet )
{
	for( UINT u = 0; u < countof( g_arrCharSet ); u++ )
	{
		if( !_tcsnicmp( g_arrCharSet[ u ].m_pcszName, strCharSet.GetData(), strCharSet.GetLength() ) )
		{
			return g_arrCharSet[ u ].m_cCharSet;
		}
	}

	TRACE( _T("Unknown characters set\n") );
	return DEFAULT_CHARSET;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -