你可以查看jdk帮助文档,有关getBytes()方法getBytes
public byte[] getBytes(String charsetName)
throws UnsupportedEncodingException
Encodes this String into a sequence of bytes using the named charset, storing the result into a new byte array.
The behavior of this method when this string cannot be encoded in the given charset is unspecified. The CharsetEncoder class should be used when more control over the encoding process is required.
Parameters:
charsetName - the name of a supported charset
Returns:
The resultant byte array
Throws:
UnsupportedEncodingException - If the named charset is not supported
public byte[] getBytes(String charsetName)
throws UnsupportedEncodingException
Encodes this String into a sequence of bytes using the named charset, storing the result into a new byte array.
The behavior of this method when this string cannot be encoded in the given charset is unspecified. The CharsetEncoder class should be used when more control over the encoding process is required.
Parameters:
charsetName - the name of a supported charset
Returns:
The resultant byte array
Throws:
UnsupportedEncodingException - If the named charset is not supported
解决方案 »
- ireport 生成pdf文件 为么是空的,我复制下代码都帮我看看,求大侠指教
- spring中packageToScan属性的问题
- String的初始化问题--请教
- 今天面试的英语题,请高手帮忙看下!
- 本人在做一个的“参数化的视图”,现在有些问题,请大家一起讨论一下,给我点意见
- 迷糊问题,越改越错!!
- 安装tomcat出错??
- mssqlserver4v65.jar这个jar包去哪里下啊???
- 我想学习J2EE,但是感觉需要学习的东西有很多,我想问问学习的流程应该是怎样的
- struts的html:select问题,谁解决了100分
- 请教问题~~关于jsp不能显示
- 标签:这种写法为何不正确!第二层循环总是打不出来值?
具体的设置编码还需要你自己写代码实现