在Ruby中如何对EBCDIC进行ASCII转换? [英] How do I do ASCII to EBCDIC translation in Ruby?

查看:186
本文介绍了在Ruby中如何对EBCDIC进行ASCII转换?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Mac OS X上使用Ruby 1.8.7。

I am using Ruby 1.8.7 on Mac OS X.

如何将ASCII转换为EBCDIC编码,以便与遗留系统进行通信。
我必须使用jruby吗?

How do I convert ASCII to EBCDIC encoding, to communicate with legacy system. Would I have to use to jruby?

推荐答案

您可以升级,但并不一定能解决问题。

You can upgrade but that doesn't necessarily solve the problem.

有多种风格的EBCDIC(谢谢IBM!),所以你需要确定大型机使用的子集。

There are multiple flavors of EBCDIC (THANK YOU IBM!) so you'll need to identify the subset your mainframe uses.

在大型机上进行编程时,我学到了一件事,哦,这么多年前,是打电话给一些大型机系统,挑选他们的大脑。他们处理从其他代码转换到EBCDIC整天,可能有一个工具,可以在飞行中。

One thing I learned to do when programming on the mainframe, oh so many years ago, was to call some of the mainframe sysops, and pick their brains. They deal with conversion from other codesets into EBCDIC all day long, and probably have a tool that can do it on the fly.

另一种方法是看是否有可以解析JSON或YAML的东西。将您的文本转换为UTF-8,将其发送到大型机,让其翻译器从UTF-8转换为EBCDIC。

An alternative would be to see if they have something that can parse JSON or YAML. Convert your text to UTF-8, send it to the mainframe, let its translator convert from UTF-8 to EBCDIC.

这篇关于在Ruby中如何对EBCDIC进行ASCII转换?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆