Windows 2000/XP上如何调用GB18030字符
2010-02-08 23:57
253 查看
安装gb18030工具包。
下载:
http://www.microsoft.com/downloads/details.aspx?FamilyID=93295d9c-89fc-4cba-ab19-ee176ea61d04&displaylang=zh-cn
http://download.pchome.net/utility/lan/gbbig5/10802.html
Windows 2000/XP上为支持GB18030在c_g18030.dll和ms4bsp.dll上新增加的函数如下:
000011A1 1 0000 ExtTextOutL
000010BA 2 0001 Get4ByteCodePage
00001280 3 0002 GetTextExtentExPointL
0000135C 5 0003 GetTextExtentPoint
0000142F 4 0004 GetTextExtentPoint32L
00001502 6 0005 MessageBoxExL
00001649 7 0006 MessageBoxL
000010E2 8 0007 Set4ByteCodePage
00001629 9 0008 TextOutL
00034F53 1 0000 BytesToUnicode
00035476 2 0001 NlsDllCodePageTranslation
00035279 3 0002 UnicodeToBytes
该 GB18030 支持工具包包含如下内容:
- 字体文件 SimSun18030.ttc
- 代码页支持文件 c_g18030.dll (只安装在Windows 2000 系统中)
- 转换工具gbunicnv.exe
- 微软4字节字符集编码支持包ms4bsp.dll
支持包安装成功后,转换工具 (gbunicnv.exe) 和微软4字节字符集编码支持包 (ms4bsp.dll) 会被安装在系统的 Program Files/GB18030Tools 文件夹下。用户可通过 Windows 2000 或 Windows XP 中的中文内码(Unicode) 输入法输入所需的 GB18030 扩充的4字节汉字。
转换工具 gbunicnv.exe 的使用方法
==============================
该转换工具用来实现GB18030-2000和 Unicode 编码格式文件的相互转换。该工具所支持的文件格式为文本文件(.txt)和HTML文件(.html)。gbunicnv.exe 的使用方法如下:
1)图形模式。执行gbunicnv.exe时不带参数,则gbunicnv.exe 将以图形模式启动。
2)命令行模式。用法:gbunicnv.exe [/U|/G|/?|/H 文件名1 [文件名2]
/H 或 /?, 显示帮助信息。
/U 或 /u, 执行GB18030-2000 到 Unicode 编码格式的转换。
/G 或 /g, 执行 Unicode 到 GB18030-2000 编码格式的转换。
开发人员附注
===========
1.Windows API对GB18030-2000 的支持
下列 Windows API 提供对GB18030-2000 的支持。IsValidCodePage(), GetCPInfo(), MultiByteToWideChar() and WideCharToMultiByte().
具体说明如下:
1) IsValidCodePage(54936) returns TRUE.
2) GetCPInfo(54936, lpCPInfo) returns TRUE.
3) MultiByteToWideChar(54936, 0, lpMultiByteStr, cbMultiByte, lpWideCharStr, cchWideChar) 完成GB18030-2000 字符串 lpMultiByteStr 到 Unicode 字符串 lpWideCharStr 的转换。
4) WideCharToMultiByte(54936, 0, lpWideCharStr, cchWideChar, lpMultiByteStr, cbMultiByte, lpDefaultChar, lpUsedDefaultChar) 完成Unicode 字符串 lpWideCharStr 到 GB18030-2000 字符串 lpMultiByteStr 的转换。
2. GB18030 函数库
微软4字节字符集编码支持包 (MS4BSP- Microsoft 4-byte Character Set Encoding Support Package) 提供了六个函数,这六个函数支持多字节编码(多达4字节)的字符串。 这些API 是从Windows 95/98/Me 提供的WCHAR (Unicode) 函数集中精选出来的。函数名与相应的ANSI 和WCHAR(Unicode) 函数完全相同,只是后缀的’A’ 或’W’被’L’替代。这些函数的参数与相应的’A’版本函数的参数接口完全相同。该支持包可使基于936代码页的应用程序向GB18030 或其他4字节编码的转换更加快捷。
MS4BSP 在Windows XP 平台的实现是作为一个简单的动态连接库 – ms4bsp.dll。 每一函数都通过调用MultiByteToWideChar() 函数将任何多字节字符串输入参数转换为UTF-16编码格式,然后调用相应的 ‘W’ 版本的函数,返回该函数的输出参数。该动态连接库假设当前系统中存在相关的字体,输入法(IME) 和注册表的设置信息。
该函数集中的缺省4字节字符编码为54936 (GB18030-2000). 将来版本的MS4BL 可能支持其他4字节编码。
接口清单:
BOOL ExtTextOutL(
HDC hdc, // handle to DC
int X, // x-coordinate of reference point
int Y, // y-coordinate of reference point
UINT fuOptions, // text-output options
CONST RECT* lprc, // optional dimensions
LPCSTR lpString, // string
UINT cbCount, // number of characters in string
CONST INT* lpDx // array of spacing values
);
BOOL GetTextExtentExPointL(
HDC hdc, // handle to DC
LPCSTR lpszStr, // character string
int cchString, // number of characters
int nMaxExtent, // maximum width of formatted string
LPINT lpnFit, // maximum number of characters
LPINT alpDx, // array of partial string widths
LPSIZE lpSize // string dimensions
);
BOOL GetTextExtentPoint32L(
HDC hdc, // handle to DC
LPCSTR lpString, // text string
int cbString, // characters in string
LPSIZE lpSize // string size
);
Int MessageBoxL(
HWND hWnd, // handle to owner window
LPCSTR lpText, // text in message box
LPCSTR lpCaption, // message box title
UINT uType // message box style
);
Int MessageBoxExL(
HWND hWnd, // handle to owner window
LPCSTR lpText, // text in message box
LPCSTR lpCaption, // message box title
UINT uType, // message box style
WORD wLanguageId // language identifier
);
BOOL TextOutL(
HDC hdc, // handle to DC
int nXStart, // x-coordinate of starting position
int nYStart, // y-coordinate of starting position
LPCSTR lpString, // character string
int cbString // number of characters
);
下载:
http://www.microsoft.com/downloads/details.aspx?FamilyID=93295d9c-89fc-4cba-ab19-ee176ea61d04&displaylang=zh-cn
http://download.pchome.net/utility/lan/gbbig5/10802.html
Windows 2000/XP上为支持GB18030在c_g18030.dll和ms4bsp.dll上新增加的函数如下:
000011A1 1 0000 ExtTextOutL
000010BA 2 0001 Get4ByteCodePage
00001280 3 0002 GetTextExtentExPointL
0000135C 5 0003 GetTextExtentPoint
0000142F 4 0004 GetTextExtentPoint32L
00001502 6 0005 MessageBoxExL
00001649 7 0006 MessageBoxL
000010E2 8 0007 Set4ByteCodePage
00001629 9 0008 TextOutL
00034F53 1 0000 BytesToUnicode
00035476 2 0001 NlsDllCodePageTranslation
00035279 3 0002 UnicodeToBytes
该 GB18030 支持工具包包含如下内容:
- 字体文件 SimSun18030.ttc
- 代码页支持文件 c_g18030.dll (只安装在Windows 2000 系统中)
- 转换工具gbunicnv.exe
- 微软4字节字符集编码支持包ms4bsp.dll
支持包安装成功后,转换工具 (gbunicnv.exe) 和微软4字节字符集编码支持包 (ms4bsp.dll) 会被安装在系统的 Program Files/GB18030Tools 文件夹下。用户可通过 Windows 2000 或 Windows XP 中的中文内码(Unicode) 输入法输入所需的 GB18030 扩充的4字节汉字。
转换工具 gbunicnv.exe 的使用方法
==============================
该转换工具用来实现GB18030-2000和 Unicode 编码格式文件的相互转换。该工具所支持的文件格式为文本文件(.txt)和HTML文件(.html)。gbunicnv.exe 的使用方法如下:
1)图形模式。执行gbunicnv.exe时不带参数,则gbunicnv.exe 将以图形模式启动。
2)命令行模式。用法:gbunicnv.exe [/U|/G|/?|/H 文件名1 [文件名2]
/H 或 /?, 显示帮助信息。
/U 或 /u, 执行GB18030-2000 到 Unicode 编码格式的转换。
/G 或 /g, 执行 Unicode 到 GB18030-2000 编码格式的转换。
开发人员附注
===========
1.Windows API对GB18030-2000 的支持
下列 Windows API 提供对GB18030-2000 的支持。IsValidCodePage(), GetCPInfo(), MultiByteToWideChar() and WideCharToMultiByte().
具体说明如下:
1) IsValidCodePage(54936) returns TRUE.
2) GetCPInfo(54936, lpCPInfo) returns TRUE.
3) MultiByteToWideChar(54936, 0, lpMultiByteStr, cbMultiByte, lpWideCharStr, cchWideChar) 完成GB18030-2000 字符串 lpMultiByteStr 到 Unicode 字符串 lpWideCharStr 的转换。
4) WideCharToMultiByte(54936, 0, lpWideCharStr, cchWideChar, lpMultiByteStr, cbMultiByte, lpDefaultChar, lpUsedDefaultChar) 完成Unicode 字符串 lpWideCharStr 到 GB18030-2000 字符串 lpMultiByteStr 的转换。
2. GB18030 函数库
微软4字节字符集编码支持包 (MS4BSP- Microsoft 4-byte Character Set Encoding Support Package) 提供了六个函数,这六个函数支持多字节编码(多达4字节)的字符串。 这些API 是从Windows 95/98/Me 提供的WCHAR (Unicode) 函数集中精选出来的。函数名与相应的ANSI 和WCHAR(Unicode) 函数完全相同,只是后缀的’A’ 或’W’被’L’替代。这些函数的参数与相应的’A’版本函数的参数接口完全相同。该支持包可使基于936代码页的应用程序向GB18030 或其他4字节编码的转换更加快捷。
MS4BSP 在Windows XP 平台的实现是作为一个简单的动态连接库 – ms4bsp.dll。 每一函数都通过调用MultiByteToWideChar() 函数将任何多字节字符串输入参数转换为UTF-16编码格式,然后调用相应的 ‘W’ 版本的函数,返回该函数的输出参数。该动态连接库假设当前系统中存在相关的字体,输入法(IME) 和注册表的设置信息。
该函数集中的缺省4字节字符编码为54936 (GB18030-2000). 将来版本的MS4BL 可能支持其他4字节编码。
接口清单:
BOOL ExtTextOutL(
HDC hdc, // handle to DC
int X, // x-coordinate of reference point
int Y, // y-coordinate of reference point
UINT fuOptions, // text-output options
CONST RECT* lprc, // optional dimensions
LPCSTR lpString, // string
UINT cbCount, // number of characters in string
CONST INT* lpDx // array of spacing values
);
BOOL GetTextExtentExPointL(
HDC hdc, // handle to DC
LPCSTR lpszStr, // character string
int cchString, // number of characters
int nMaxExtent, // maximum width of formatted string
LPINT lpnFit, // maximum number of characters
LPINT alpDx, // array of partial string widths
LPSIZE lpSize // string dimensions
);
BOOL GetTextExtentPoint32L(
HDC hdc, // handle to DC
LPCSTR lpString, // text string
int cbString, // characters in string
LPSIZE lpSize // string size
);
Int MessageBoxL(
HWND hWnd, // handle to owner window
LPCSTR lpText, // text in message box
LPCSTR lpCaption, // message box title
UINT uType // message box style
);
Int MessageBoxExL(
HWND hWnd, // handle to owner window
LPCSTR lpText, // text in message box
LPCSTR lpCaption, // message box title
UINT uType, // message box style
WORD wLanguageId // language identifier
);
BOOL TextOutL(
HDC hdc, // handle to DC
int nXStart, // x-coordinate of starting position
int nYStart, // y-coordinate of starting position
LPCSTR lpString, // character string
int cbString // number of characters
);
相关文章推荐
- 如何在 Windows 2000、XP 的桌面上增加公文包
- 如何在已装Windowns XP机器上再装Windows 2000
- 如何让 Windows 2000 XP 2003启动后自动登录
- Windows 2000/XP下如何实现红外手机上网?
- 如何在 Windows 2000 XP 2003中编辑 Boot.ini 文件实现多重启动及该文件作用
- 编程读取windows98/2000/xp/2003的登录密码
- 如何在 Windows 2000 中使用 COMPRESS、COMPACT 和 EXPAND 命令压缩或解压缩文件和文件夹
- Windows 2000/XP进程
- Windows 98/2000/XP/2003访问XP的用户验证问题
- 如何在Windows 2000下修改MAC地址
- 如何在WINDOWS(XP)下使用copSSH配置GIT服务器+TortiseGIT客户端
- 解读Windows2000/XP分层驱动模型
- 如何将 Windows 2000 安装移到不同的硬件
- 快速恢复Windows 2000/XP遗忘的管理员密码
- WINDOWS NT/2000下如何屏蔽CTRL+ALT+DEL http://www.vckbase.com/document/viewdoc/?id=242
- 如何将 Windows 2000 安装移到不同的硬件
- c#中如何跨线程调用windows窗体控件
- 如何跨线程调用Windows窗体控件
- 一个windows应用程序内部到底有没有DLL文件的代码呢???它是如何调用DLL的???