首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VC/MFC >

怎么取得 charset

2012-02-03 
如何取得 charset我需要根据一些文本文件(ansi编码),批量生成HTML文件.需要在html头加入类似-------------

如何取得 charset
我需要根据一些文本文件(ansi编码),批量生成HTML文件.

需要在html头加入类似

--------------------------
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>File Name</title>
</head>

--------------------------

要不然显示出来会乱码.

用什么函数可以取得当前机器默认的charset?

类似
switch (GetSystemDefaultLangID()){
  case 2052:
  return "gb2312";
  case ......
}


谢谢!

[解决办法]
当前机器默认的?不是要根据html文件内容判断么?
[解决办法]
GetSystemDefaultLangID or GetUserDefaultLangID 
With them,you can get a return LANGID of your current user/System

Look up it in "Language Identifier Constants and Strings",http://msdn.microsoft.com/en-us/library/dd318693(VS.85).aspx

You perhaps get the information you wanted

Enjoy ;)

热点排行