代码页和字符集之间的区别 [英] Difference between code page and Character set

查看:94
本文介绍了代码页和字符集之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须使用多字节转换为宽字符使用代码页(shift jis是932,字符集是128)有什么区别..

解决方案

请参阅代码页维基百科 [ ^ ]文章:

引用:

在计算中,代码页是一个描述用于编码特定字形集的字符集的值表

这两个术语通常用于描述相同的字符集。 代码页由操作系统使用,而字符集用于因特网上下文(例如,在HTML,XML和邮件头中)。



区别在于代码页定义为数字,字符集由文本字符串表示。例如,代码页号923对应于字符集ISO-8859-15。





[更新发布评论和解决方案的问题]

引用:

有没有办法将字符集转换为代码页

没有执行此任务的功能。您可以实现查找表以将字符集名称映射到代码页码。但请注意,通常存在字符集名称的变体和别名(例如,Windows字符集125x使用前缀windows-和cp)。



另请参阅MSDN博客文章 Microsoft WindowsANSI代码页(编码)的预期名称 [ ^ ]。


i have to convert using multibyte to wide char its using code page (shift jis is 932 and character set is 128) what is the difference between ..

解决方案

See the Code Page Wikipedia[^] article:

Quote:

In computing, a code page is a table of values that describes the character set used for encoding a particular set of glyphs

Both terms are often used to describe the same. "Code Page" is used by operating systems while "Character Set" is used in the internet context (e.g. in HTML , XML, and mail headers).

The difference is that code pages are defined as numbers and character sets are represented by text strings. The code page number 923 for example corresponds to the character set "ISO-8859-15".


[UPDATE for question posted as comment and solution]

Quote:

is there any way to convert character set to code page

There is no function to perform this task. You may implement a lookup table to map character set names to code page numbers. But note that there are often variations and aliases of character set names (e.g. the Windows character sets 125x use the prefixes "windows-" and "cp").

See also the MSDN Blog post Expected names of Microsoft Windows "ANSI" Code Pages (Encodings)[^].


这篇关于代码页和字符集之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆