From 3974c0932df8281f4e0fa34c36c07a9d72f1155d Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 6 May 2014 18:38:09 -0700 Subject: dd: fix conv=ascii, conv=ebcdic, conv=ibm to match POSIX Problem reported by Don Baggett in . * NEWS: * doc/coreutils.texi (dd invocation): Document this. * src/dd.c (conversions): conv=ascii implies conv=unblock. conv=ebcdic and conv=ibm imply conv=block. (ascii_to_ebcdic, ebcdic_to_ascii): Correct to match POSIX 1003.1-2013. * tests/dd/ascii.sh: New file. * tests/local.mk (all_tests): Add it. --- doc/coreutils.texi | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'doc/coreutils.texi') diff --git a/doc/coreutils.texi b/doc/coreutils.texi index a949ffcac..789cd68e5 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -8621,21 +8621,26 @@ Conversions: Convert EBCDIC to ASCII, using the conversion table specified by POSIX@. This provides a 1:1 translation for all 256 bytes. +This option implies @samp{conv=unblock}; input is converted to +ASCII before trailing spaces are deleted. @item ebcdic @opindex ebcdic@r{, converting to} Convert ASCII to EBCDIC@. This is the inverse of the @samp{ascii} conversion. +This option implies @samp{conv=block}; trailing spaces are added +before being converted to EBCDIC@. @item ibm @opindex alternate ebcdic@r{, converting to} -Convert ASCII to alternate EBCDIC, -using the alternate conversion table specified by POSIX@. +This acts like @samp{conv=ebcdic}, except it +uses the alternate conversion table specified by POSIX@. This is not a 1:1 translation, but reflects common historical practice for @samp{~}, @samp{[}, and @samp{]}. The @samp{ascii}, @samp{ebcdic}, and @samp{ibm} conversions are -mutually exclusive. +mutually exclusive. If you use any of these options, you should also +use the @samp{cbs=} option. @item block @opindex block @r{(space-padding)} -- cgit v1.2.3-70-g09d2