- 1、本文档共15页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
java 字符编码(国外英文资料)
java 字符编码(国外英文资料)
String newStr = new String (), utf-8);
In Java String class is carried out in accordance with the unicode encoding, when using a String (byte [] bytes, String encoding) in the String structure, encoding is referring to bytes of data are encoded by that way, what is the String rather than the encoding, in other words, is to make the system the bytes of data by encoding encoding converts unicode. If not specified, the bytes encoding will be determined by the JDK based on the operating system.
When we read data from a file, it is best to use the InputStream method, and then use a String (byte [] bytes, String encoding) to indicate the encoding of the file. Do not use Reader mode, because the Reader method automatically converts the file content to unicode encoding according to the encoding specified by the JDK.
When we read text data from the database, we use the ResultSet. GetBytes () method to get the byte array, which also USES the string construct method with the encoding method.
The ResultSet rs;
Bytep [] bytes = RRS.
String STR = new String (bytes, gb2312);
Dont take the following steps.
The ResultSet rs;
String STR = rr.getstring ();
STR = new String ( iso8859-1 ), gb2312);
This type of encoding conversion is efficient. The reason for this is that the ResultSet in the getString () method, the default data library is encoded in iso8859-1. The system converts the data to unicode according to the iso8859-1 encoding. Use STR. GetBytes ( iso8859-1 ) to restore the data, then use new String (bytes, gb2312) to convert the data from gb2312 to unicode, with a number of steps in the middle.
When you read the parameters from HttpRequest, you set the encoding method by using the reqeust setCharacterEncoding () method, which is the right thing to read.
Say first Java.
Any String resource in the JVM is Unicode, meaning that any String type data is Unicode encoded. There are no exceptions. Since there is only one encoding, we can say that the String inside th
您可能关注的文档
- 74系列集成电路名称与功能(国外英文资料).doc
- AVR控制矩阵键盘,12864显示简单计算器(国外英文资料).doc
- AWOS 题库基础知识部分(选择题)(国外英文资料).doc
- apache+mysql+php_for_linux全攻略(国外英文资料).doc
- AutoCAD 2002 完全使用手册(DOC) ch16_ok(国外英文资料).doc
- bat自动按键(国外英文资料).doc
- autorun.inf编写方法搜集(国外英文资料).doc
- Beyond 3G移动通信系统的小区搜索算法 - C114(国外英文资料).doc
- BIOS升级篇(国外英文资料).doc
- AYHFDIO(国外英文资料).doc
- 福莱特玻璃集团股份有限公司海外监管公告 - 福莱特玻璃集团股份有限公司2024年度环境、社会及管治报告.pdf
- 广哈通信:2024年度环境、社会及治理(ESG)报告.pdf
- 招商证券股份有限公司招商证券2024年度环境、社会及管治报告.pdf
- 宏信建设发展有限公司2024 可持续发展暨环境、社会及管治(ESG)报告.pdf
- 品创控股有限公司环境、社会及管治报告 2024.pdf
- 中信建投证券股份有限公司2024可持续发展暨环境、社会及管治报告.pdf
- 洛阳栾川钼业集团股份有限公司环境、社会及管治报告.pdf
- 361度国际有限公司二零二四年环境、社会及管治报告.pdf
- 中国神华能源股份有限公司2024年度环境、社会及管治报告.pdf
- 广西能源:2024年环境、社会及治理(ESG)报告.pdf
最近下载
- 矿用隔爆兼本安型控制器工艺流程图.doc VIP
- 政治学概论政治学概论编写组05政党与政党制度.ppt VIP
- 《乡村旅游规划与实践》课件——项目七 乡村旅游商品开发与设计.pptx VIP
- 国家义务教育质量监测心理健康测试题.pdf VIP
- 《分数加法和减法》单元整体设计 -2023-2024学年五年级下册数学人教版.doc VIP
- 《0~3岁婴幼儿保育与教育》PPT教学课件(全).pptx VIP
- 小学科学实验课学生合作学习策略与互动模式研究教学研究课题报告.docx
- 测绘工程管理与法律法规 测绘违法案例60讲 5测绘违法案例五.ppt
- 第六届中国国际“互联网+”大学生创新创业大赛项目计划书【模板】.pdf
- 政治学05 政党与政党制度.ppt VIP
文档评论(0)