Ascii在C中的ebcidic转换 [英] Ascii to ebcidic conversion in C

查看:99
本文介绍了Ascii在C中的ebcidic转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





c中是否有内置函数将ascii值转换为ebcidic?



或者我们需要自己编写这个函数吗?



我尝试了什么:



i可以看到一些转换函数,但想知道有没有可用的函数

Hi,

Is there any in built function in c to convert ascii value to ebcidic?

or we need to write the function our own?

What I have tried:

i can see some conversion functions but want to know is there any functions available

推荐答案

有一个IBM函数可以做到:(string)IBM知识中心 [ ^ ],(chars)IBM Knowledge中心 [ ^ ]但他们需要您可能无法访问的非标准IBM库。这是有道理的,因为只有那些曾经使用过EBCDIC的人才是IBM ......:笑:



说实话,这是一个非常简单的转换:两个阵列255个字符,一个由ASCII索引组织,另一个由EBCDIC组成,非常简单: IBM知识中心 [ ^ ]



但我很着迷,知道仍在使用EBCDIC的设备仍在运行? :D
There is an IBM function to do it: (string) IBM Knowledge Center[^], (chars) IBM Knowledge Center[^] But they will require non-standard IBM libraries which you probably won't have access to. Which makes sense, since about the only people who ever used EBCDIC was IBM ... :laugh:

To be honest, it's a pretty trivial conversion: two arrays of 255 characters, one organised by ASCII index, the other by EBCDIC would do it very simply: IBM Knowledge Center[^]

But I'm fascinated to know what the heck equipment is still running that uses EBCDIC anyway? :D


一个适合你的策略 - 一个功能的替代品 - 也许只是为了考虑 - 但也许你需要的。



创建一个256字节的数组。假设数组索引是源字符的ASCII值。将each的值设置为EBCDIC值。现在,您可以通过将输入作为ASCII值循环并将分配给该索引的值写入新字符串来转录数组,而不是函数调用。



最终,无论如何,每个字符都需要被处理 - 这会跳过函数调用带的开销而不是使用查找列表 - 这通常非常快。
A strategy for you - an alternative to a function - maybe just for thinking about - but maybe what you need.

Create a 256 byte array. Assume the array index is the ASCII value of your source character. Set the value of each to the EBCDIC value. Now, instead of a function call you can transcribe the array by looping through the input as ASCII values and writing the value assigned to that index to your new string.

Ultimately, any way you do this, each character will need to be addressed - this skips the overhead of a function call band instead uses a lookup list - which are ordinarily very fast.


Quote:

c中是否有任何内置函数将ascii值转换为ebcidic?

Is there any in built function in c to convert ascii value to ebcidic?



Short回答:没有


Short answer: No

引用:

还是我们需要编写自己的函数?

or we need to write the function our own?



简答:是



如果您的功能有问题,请显示代码并解释问题以获得帮助。


Short answer: Yes

If you have a problem on your function, show code and explain problem to get help.

这篇关于Ascii在C中的ebcidic转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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