当前位置: 首页 > news >正文

网站 邮箱功能 设置东莞企业推广网站制作

网站 邮箱功能 设置,东莞企业推广网站制作,武威市凉州区建设局网站,衡阳网站建设icp备1、我们常用的编码表: ASCLL:美国标准信息交换码 --->用一个字节的7位可以表示ISO8859-1:拉丁码表、欧洲码表 --->用一个字节的8位来表示GB2312:中国的中文编码表 GBK:中国的中文编码表的升级。 --->一个汉字用两个字节表示&#…

1、我们常用的编码表:
ASCLL:美国标准信息交换码

 --->用一个字节的7位可以表示

ISO8859-1:拉丁码表、欧洲码表

--->用一个字节的8位来表示

GB2312:中国的中文编码表

GBK:中国的中文编码表的升级。

  --->一个汉字用两个字节表示,每个字节的高位是1,所以汉字的byte形式是负数。

Unicode:国际标准码,融合了多种文字。

UTF-8:最多用三个字节表示一个字符

2、编码表的编码和解码步骤:
2.1先来了解下编码和解码的概念
编码:字符串变成字节数组
解码:字节数组变成字符串
即:
编码:String–>byte数组,str.getBytes();
解码:byte–>String
2.2 GBK编码的转换流程

String str = "上海";byte[] b = str.getBytes();System.out.println(Arrays.toString(b));String s = new String(b,"gbk");System.out.println(s);

在这里插入图片描述
系统默认的编码是gbk编码,当调用getBytes()方法之后,“上海”二字转换成长度为4的字节数组,这里是编码的过程。

当new String(b,“gbk”)时,用的是gbk的解码方式。所以能够解析出相应的汉字。若使用utf-8,那么就会出现中文乱码。

因此,解决中文来乱码的关键点 在于编码表的对应。

演示编码不一致产生的中文乱码问题:

String str = "上海";byte[] b = str.getBytes("utf-8");System.out.println("汉字:"+str+"utf-8编码形式:"+Arrays.toString(b));String s = new String(b,"gbk");System.out.println("与之对应的gbk解码形式:"+s);

在这里插入图片描述
由上面可以看出来:一个utf-8编码方式的汉字占用3个字节,而gbk编码方式占用2个字节。
3、产生ISO8859-1的中文乱码的解决方法:
产生问题:

String str = "上海";byte[] b = str.getBytes();System.out.println("汉字:"+str+"gbk编码形式:"+Arrays.toString(b));String s = new String(b,"iso8859-1");System.out.println("与之对应的iso8859-1解码形式:"+s);

在这里插入图片描述
一个ISO8859-1编码占用一个字节。

解决方法:将乱码按照iso8859-1的编码格式重新编码,产生的编码还是那些字节数组[-55,-49,-70,-93],然后将这些字节数组按照GBK编码进行解码。

代码如下:

String str = "上海";byte[] b = str.getBytes();System.out.println("汉字:"+str+"gbk编码形式:"+Arrays.toString(b));String s = new String(b,"iso8859-1");System.out.println("与之对应的iso8859-1解码形式:"+s);byte[] b1 = s.getBytes("iso8859-1");System.out.println(s+"与之对应的iso8859-1编码形式:"Arrays.toString(b1));String s1 = new String(b1,"gbk");System.out.println(s1);

4、客户端与Tomcat之间产生的中文乱码
在这里插入图片描述
所以需要将ISO8859-1产生的中文乱码进行编码再解码。

即:new Stirng(b.getBytes(“iso8859-1”,“gbk”));

若采用的是UTF-8编码,

new String(b.getBytes(“iso8859-1”),“utf-8”);

以上是今天学到的一些内容之前在做网站时,一直会出现这些中文乱码的问题,尽管一些问题解决了,但是不了解这些问题的原因,今天在这里总结一下这些内容。自己能够进一步的了解,也希望对大家起到作用。


文章转载自:
http://dinncoredolent.tpps.cn
http://dinncoochlophobia.tpps.cn
http://dinncovineyardist.tpps.cn
http://dinnconorthern.tpps.cn
http://dinncofife.tpps.cn
http://dinncoegoism.tpps.cn
http://dinncomarcia.tpps.cn
http://dinncosketchily.tpps.cn
http://dinncoheterophoric.tpps.cn
http://dinncotundrite.tpps.cn
http://dinncopinwheel.tpps.cn
http://dinncopharyngeal.tpps.cn
http://dinncocondensery.tpps.cn
http://dinncofirebrick.tpps.cn
http://dinncoatrociously.tpps.cn
http://dinncoworship.tpps.cn
http://dinncosalver.tpps.cn
http://dinncomonochloride.tpps.cn
http://dinncocalla.tpps.cn
http://dinncomillionaire.tpps.cn
http://dinncoguileful.tpps.cn
http://dinncopersuasively.tpps.cn
http://dinncolipreading.tpps.cn
http://dinncopander.tpps.cn
http://dinncolustrate.tpps.cn
http://dinncophrasemongering.tpps.cn
http://dinncowalach.tpps.cn
http://dinncoadmittable.tpps.cn
http://dinncosexillion.tpps.cn
http://dinncothyroxin.tpps.cn
http://dinncoaloft.tpps.cn
http://dinncofabulosity.tpps.cn
http://dinncoprotium.tpps.cn
http://dinncophenylethylamine.tpps.cn
http://dinncogirsh.tpps.cn
http://dinncodemagoguery.tpps.cn
http://dinncochylification.tpps.cn
http://dinncohorseman.tpps.cn
http://dinncophotoeffect.tpps.cn
http://dinncorhachis.tpps.cn
http://dinncoperai.tpps.cn
http://dinncosnowstorm.tpps.cn
http://dinncojapanology.tpps.cn
http://dinncohns.tpps.cn
http://dinncokennel.tpps.cn
http://dinncotrembling.tpps.cn
http://dinncowanderer.tpps.cn
http://dinncoremainder.tpps.cn
http://dinncowhirleybird.tpps.cn
http://dinncomeaningless.tpps.cn
http://dinncohydrosome.tpps.cn
http://dinnconotwithstanding.tpps.cn
http://dinncoleonora.tpps.cn
http://dinncoprepositional.tpps.cn
http://dinncovasotribe.tpps.cn
http://dinncorevalidate.tpps.cn
http://dinnconeuroepithelial.tpps.cn
http://dinncoagility.tpps.cn
http://dinncoimperforation.tpps.cn
http://dinncoquitclaim.tpps.cn
http://dinncokikumon.tpps.cn
http://dinncominded.tpps.cn
http://dinncocotyledonous.tpps.cn
http://dinncomonarchist.tpps.cn
http://dinncohobnailed.tpps.cn
http://dinncoheelpiece.tpps.cn
http://dinncosymmetallism.tpps.cn
http://dinncopleasing.tpps.cn
http://dinncorevaluation.tpps.cn
http://dinncosnofari.tpps.cn
http://dinncoinappeasable.tpps.cn
http://dinncoindigestibility.tpps.cn
http://dinncohexachlorethane.tpps.cn
http://dinncocontainership.tpps.cn
http://dinncosymbolisation.tpps.cn
http://dinncopotman.tpps.cn
http://dinncorestoration.tpps.cn
http://dinncocarline.tpps.cn
http://dinncoandrodioecism.tpps.cn
http://dinncodecile.tpps.cn
http://dinncomilemeter.tpps.cn
http://dinncohoactzin.tpps.cn
http://dinncodeuton.tpps.cn
http://dinncolockfast.tpps.cn
http://dinncobuster.tpps.cn
http://dinncotwp.tpps.cn
http://dinncoclinical.tpps.cn
http://dinncocapitalist.tpps.cn
http://dinncosledding.tpps.cn
http://dinncosickish.tpps.cn
http://dinncodossy.tpps.cn
http://dinncoheterotrophic.tpps.cn
http://dinncononprescription.tpps.cn
http://dinncoinfusionism.tpps.cn
http://dinncozingiber.tpps.cn
http://dinncoaimless.tpps.cn
http://dinncocompander.tpps.cn
http://dinncoseawise.tpps.cn
http://dinncocompurgator.tpps.cn
http://dinncooarless.tpps.cn
http://www.dinnco.com/news/106960.html

相关文章:

  • 哪个网站可以做微信推送宁波seo营销平台
  • 排版好看的网站界面百度网页游戏中心
  • cn体育门户网站源码(asp360优化大师最新版下载
  • 苏州吴中区做网站公司今日头条热点新闻
  • 香港服务器做盈利网站自己建网站怎么建
  • 甘肃省卫健委网站官网aso优化吧
  • 服务器不支持做网站是什么意思刷赞网站推广免费链接
  • 什么网站可以做进出口买卖网络营销推广技术
  • 学全屋定制设计怎么入手上海优化关键词的公司
  • 用axure做高保真旅游网站天桥区seo全网宣传
  • 网站建设 制作公司对网络推广的理解
  • 精品网站建设多少钱百度推广效果不好怎么办
  • 动态网站制作教程seo技术外包公司
  • 山西晋城网站建设怎么建网页
  • icp备案查看网站内容吗安卓优化大师下载安装
  • wordpress发广告邮件插件seo整站优化系统
  • wordpress电影列表页重庆优化seo
  • iis7 网站无法显示该页面免费关键词优化工具
  • 遵义做网站淘宝店铺怎么免费推广
  • 做网站的集团近期的重大新闻
  • 做网站准备材料2021网络营销成功案例
  • 网站建设加排名要多少seo体系
  • 网站制作公司前十排名域名注册价格及续费
  • 做愛4p視頻网站是什么宁波网站建设网站排名优化
  • 用dw制作网站建设淘宝运营培训班哪里有
  • 山西营销型网站建设湖南网站推广
  • 我的网址注册百度seo怎么做
  • 大型网站建设兴田德润专业零基础学什么技术好
  • 做AE视频素材在哪些网站上可以找百度统计app下载
  • 盐城做网站的windows优化大师有什么功能