views:

394

answers:

2

Hi all,

what I want to do is to be able to mount via sshfs some files on the mainframe via USS on my local PC. I can do that but sshfs doesnt do straight off the conversion from EBCDIC to ascii/unicode. Is there any flags that i can set.

Alternativly, does anybody know of a library that does EBCDIC to ASCII conversions so i can add to SSHFS?

Cheers

Mark

+1  A: 

There are several libraries for character set conversion — iconv (normally part of your C library; see for example iconv_open) and GNU recode come to mind.

derobert
+2  A: 

Be aware though that transparent charset conversion is a very dangerous game. Are you absolutely sure that you will never read anything but EBCDIC files via SSHFS? What if there is binary data?

Some systems used transparent conversions in the past:

  • the infamous "ASCII mode" of FTP, which messed up many binary downloads
  • the vfat filesystem in Linux, which notes: "Programs that do computed lseeks won't like in-kernel text conversion. Several people have had their data ruined by this translation. Beware!"

So I'd strongly advise to be aware of the consequences.

Why not use use an editor that can handle EBCDIC? Vim e.g. can do it (if it is compiled in).

sleske