惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

小众软件
小众软件
IT之家
IT之家
博客园 - 聂微东
www.infosecurity-magazine.com
www.infosecurity-magazine.com
P
Privacy International News Feed
人人都是产品经理
人人都是产品经理
PCI Perspectives
PCI Perspectives
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 叶小钗
V
Vulnerabilities – Threatpost
美团技术团队
S
Secure Thoughts
N
News | PayPal Newsroom
L
LINUX DO - 最新话题
腾讯CDC
Application and Cybersecurity Blog
Application and Cybersecurity Blog
雷峰网
雷峰网
B
Blog
MyScale Blog
MyScale Blog
T
The Blog of Author Tim Ferriss
TaoSecurity Blog
TaoSecurity Blog
N
News and Events Feed by Topic
Blog — PlanetScale
Blog — PlanetScale
C
Check Point Blog
T
Tailwind CSS Blog
月光博客
月光博客
Simon Willison's Weblog
Simon Willison's Weblog
Hacker News: Ask HN
Hacker News: Ask HN
The Last Watchdog
The Last Watchdog
Google DeepMind News
Google DeepMind News
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
MongoDB | Blog
MongoDB | Blog
S
Security @ Cisco Blogs
Jina AI
Jina AI
Engineering at Meta
Engineering at Meta
S
Security Affairs
Forbes - Security
Forbes - Security
P
Palo Alto Networks Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
博客园 - 司徒正美
博客园 - 三生石上(FineUI控件)
T
Tor Project blog
O
OpenAI News
L
Lohrmann on Cybersecurity
Security Archives - TechRepublic
Security Archives - TechRepublic
P
Proofpoint News Feed
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
L
LangChain Blog
B
Blog RSS Feed
H
Hackread – Cybersecurity News, Data Breaches, AI and More

博客园 - dahai.net

常用的DOCUMENT.EXECCOMMAND WebForm中的tip - dahai.net - 博客园 修改所有用户表/存储过程/视图/触发器/自定义函数的所有者为dbo,则用游标(不要理会错误提示) 在无锡办理10万元注册资本的企业,所需要时间和费用 Win 2003下无敌权限提升方法(转) ftp讨论站连接 使用.NET实现断点续传 使用WMI创建站点和虚拟目录,并设置属性 - dahai.net - 博客园 千万数据翻页解决方案 CHM格式解析 从互联网加载图片到PictureBox1 Visual Studio .NET已检测到指定的Web服务器运行的不是ASP.NET 1.1 版 - dahai.net [分享]千万数量级分页存储过程(带效果演示)(转) 网站分析专用名词 列出sqlserver数据库孤立用户 写数据到文件 - dahai.net - 博客园 网页模糊归类算法的应用与实现 搜索引擎的实现原理 一种快速的未登陆词识别方法(原理和实现)
总结字符串编码(转)
dahai.net · 2005-12-29 · via 博客园 - dahai.net

这几个月作手机短信的项目,碰到了很多字符编码的问题,真头痛。经过多番资料的搜索、亲手尝试和高人的指点,现在好像没那么迷惘了。现作了一些总结跟大家分享(有误之处请指点)

  首先应该把字节数组看成是String的载体。
  dot Net使用的字符串String是Unicode编码的;它也是以Unicode编码的形式显示字符串。

  以下是用自己语言对几个常用函数的说明:
  (自己总结的,反正看不明MSDN)
  bytes=System.Text.Encoding.Unicode.GetBytes(str)
  作用:把str的载体作Unicode->Unicode的编码转换--也就是没有对载体作任何的转换。因些使用此函数可以得代表该String载体的字节数组。
  str=System.Text.Encoding.Unicode.GetString(bytes)
  作用:对字节数组作Unicode->Unicode的编码转换--即没有转换,把经过转换后的字节数组作为str的载体。

  bytes=System.Text.Encoding.Utf8.GetBytes(str)
  作用:把str的载体作Utf8->Unicode的编码转换。返回的是经过转换后的字符数组
  str=System.Text.Encoding.Utf8.GetString(bytes)
  作用:对字节数组作Gb2312->Unicode的编码转换,把经过转换后的字节数组作为str的载体。

  bytes=System.Text.Encoding.GetEncoding("GB2312").GetBytes(str)
  作用:把str的载体作Gb2312->Unicode的编码转换。返回的是经过转换后的字符数组
  str=System.Text.Encoding.GetEncoding("GB2312").GetString(bytes)
  作用:对字节数组作Gb2312->Unicode的编码转换,把经过转换后的字节数组作为str的载体。

如此类推
  bytes=System.Text.Encoding.GetEncoding("XXX").GetBytes(str)
  作用:把str的载体作XXX->Unicode的编码转换。返回的是经过转换后的字符数组
  str=System.Text.Encoding.GetEncoding("XXX").GetString(bytes)
  作用:对字节数组作XXX->Unicode的编码转换,把经过转换后的字节数组作为str的载体。

这里是我收集的一些有关字符编码的资料:http://61.145.116.154/bm/
还有:
http://www.unicode.org/charts/unihan.html
根据Unicode编码查其对应字符的字形、Utf8、汉字区位码等
http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/GB/GB2312.TXT Unicode与Gb2312的对照表
http://www.sun.com/developers/gadc/technicalpublications/articles/mabiao.txt
Unicode与Gbk对照表