如何将十六进制值更改为 EBCDIC 字符

发布于 2024-09-01 22:32:38 字数 175 浏览 3 评论 0原文

中将 HEX 值转换为 ebcdic char 类型的最简单方法是什么

在Java 下面的示例将返回 at 符号,但我想获得 ebcidic 等效项,即 space char..

String hex = "40"; char c = (char) Integer.parseInt(hex, 16);

What is the simplest way to convert HEX value to ebcdic char type in Java

e.g. The example below will return at sign but I would like to get ebcidic equivalent i.e. space char..

String hex = "40";
char c = (char) Integer.parseInt(hex, 16);

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

花海 2024-09-08 22:32:38

简单且最有效的解决方案可能是自己编写一个查找表,例如基于 http://www.natural-innovations.com/computing/asciiebcdic.html

其他解决方案可以在此处找到。

Simples and most efficient solution would probably be to write up a lookup-table yourself, based on for instance http://www.natural-innovations.com/computing/asciiebcdic.html.

Other solutions can be found here.

迎风吟唱 2024-09-08 22:32:38

将十六进制字符转换为 ebcdic(例如:C1

byte b[] = {(byte) Integer.parseInt("C1", 16)};
System.out.print(new String(b, "Cp037"));

结果将为 A

To convert hex char to ebcdic (example: C1)

byte b[] = {(byte) Integer.parseInt("C1", 16)};
System.out.print(new String(b, "Cp037"));

The result will be A

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文