Re: convert ASCII to EBCDIC



jbercx@xxxxxxxx wrote:
we use the dd command to convert a ASCII file to EBCDIC. After
conversion we ftp this file to a mainframe for further use of it.
This file contains records with customer names. Sometimes a name has a
ó in it like mr. Bókhoven. The convertion of this name is not
correct. It replace the ó with a ^.
How can we convert this correct. We tried these commands with the same
incorrect result.
dd if=textin of=textof conv=ebcdic
dd if=textin of=textof conv=ibm

The 'dd conv=' is rather limited in its ebcdic translation.
The 'man conv' says:
The character-set mappings associated with ... conv=ebcdic
... subset of EBCDIC characters found on most ...
Note the words "subset" and "most".

I suggest you use the 'iconv' command, which can use a larger
set of code pages. The trick will be finding the code page
which has the EBCDIC ó in it. Start with 'man iconv' and/or
'smit iconv'. You will also want to install as many of the
bos.iconv.* filesets as needed to find the right code page.
In your case install at least bos.iconv.ucs.ebcdic.

If you can't find a enbdic code page which already contains
the characters you need you can create a custom iconv table
with the genxlt command.

Paul Landay
.



Relevant Pages

  • GNU libiconv 1.13 released
    ... GNU libiconv is the character set conversion library that provides a decent ... The library and the iconv program now understand platform dependent aliases, ... conversion descriptor in pre-allocated memory, ...
    (gnu.announce)
  • ANNOUNCE: Text::Iconv 1.4
    ... raise an exception on conversion errors. ... This module provides a Perl interface to the iconv() codeset ... you convert text from one character set into another character set ... on your system (if it's a UNIX or UNIX-like system). ...
    (comp.lang.perl.modules)
  • ANNOUNCE: Text::Iconv 1.4
    ... raise an exception on conversion errors. ... This module provides a Perl interface to the iconv() codeset ... you convert text from one character set into another character set ... on your system (if it's a UNIX or UNIX-like system). ...
    (comp.lang.perl.modules)
  • Re: a couple modest MV proposals
    ... The fold oconv code is for a basic program. ... could all write our own conversion and processing routines to handle dates. ... We could make the OS smaller by removing all of that pesky time conversion ... code that doesn't handle iconv dates correctly anyway. ...
    (comp.databases.pick)
  • Re: How are people making use of Iconv?
    ... >>> I dislike that Iconv raises an exception when it finds characters it can ... >>> characters and just try to make the best of the text. ... strings as arrays of bytes and strings as sets of characters with an ...
    (comp.lang.ruby)