zoukankan
html css js c++ java
GB2312编码转换回汉字
程序是别人的(没办法做改动),要读它写入的cookie内容,解码前对比内容得知其写入时使用GB2312编码,而JS为了跨平台,所提供的码解码函数使用的是Unicode编码的,直接提取出来的是一堆乱码。
因些想写一个中间的转换函数,但网上能找到的都是PHP的转换过程,看不懂,因为最后要看是内容而已,而VBS中有一个chr函数,用它可以取到编码所对应的汉字。
比如“中”字的GB2312编码是%D6%D0,则使用如下代码可以得到编码所对应的汉字。
<
SCRIPT LANGUAGE
=
"
VBScript
"
>
MyStr
=
Chr
(
&
hD6D0)
MsgBox
MyStr
</
SCRIPT
>
查看全文
相关阅读:
[模板]RMQ(冲刺准备中)
洛谷 P2569[SCOI2010]股票交易(动规+单调队列)
洛谷 P3659 [USACO17FEB]Why Did the Cow Cross the Road I G
粗略了解fill与fill_n
计蒜客D2T2 蒜头君的排序(动态维护树状数组)
洛谷 P3478 [POI2008]STA-Station
洛谷 P2899 [USACO08JAN]手机网络Cell Phone Network
洛谷 P3112 [USACO14DEC]后卫马克Guard Mark
洛谷 P3092 [USACO13NOV]没有找零No Change
洛谷 P2850 [USACO06DEC]虫洞Wormholes 判负环
原文地址:https://www.cnblogs.com/phoenix/p/136865.html
最新文章
echarts实践-图表划分区域并设置不同颜色
Mysql通过CodeFirst方式使用EF
Reporting Services添加图像的3种方式
echarts实践-用线分割的点图
给echarts的图表加水平直线或其它直线
Mysql重置root密码遇到的坑(忘记密码)
图文流布局
企业号员工自动绑定到应用
pyodbc使用
CentOS连AzureSql(ODBC)
热门文章
文件上传利器SWFUpload使用指南
网站默认文档配置
yieId浅谈
c#静态成员和静态类
使用虚方法和多态来改善源代码的扩展性
继承中的构造函数问题
c#编译执行过程
WebService学习笔记
html + ashx 实现Ajax省市联动
关于HMTL -[HTML5]
Copyright © 2011-2022 走看看