如何取得 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 ;)