简体   繁体   English

如何从十六进制字符串转换为普通字符串?

[英]How can I convert from hexadecimal string to normal string?

I received to HTTP GET response as hexadecimal string data with socket in java. 我收到了带有Java中套接字的十六进制字符串数据作为HTTP GET响应。 But I want to convert normal string to this data for HTML format. 但是我想将普通字符串转换为HTML格式的数据。 How can I make it ? 我该怎么做?

byte[] bytes = Hex.decodeHex(YourhexString .toCharArray());
String s=new String(bytes, "UTF-8");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM