Package: coreutils
Version: 9.1-1
Version: 8.32-4+b1
Severity: normal

Dear Maintainer,

Issue 8 Draft 3, XCU, od, OPTIONS says:
108132  −t type_string
108133    Specify one or more output types. See the EXTENDED DESCRIPTION 
section. The
108134    application shall ensure that the type_string option-argument is a 
string specifying
108135    the types to be used when writing the input data. The string shall 
consist of the
108136    type specification characters a, c, d, f, o, u, and x, specifying 
named character,
108137    character, signed decimal, floating point, octal, unsigned decimal, 
and
108138    hexadecimal, respectively. The type specification characters d, f, o, 
u, and x can be
108139    followed by an optional unsigned decimal integer that specifies the 
number of
108140    bytes to be transformed by each instance of the output type. The type 
specification
108141    character f can be followed by an optional F, D, or L indicating that 
the conversion
108142    should be applied to an item of type float, double, or long double, 
respectively.
108143    The type specification characters d, o, u, and x can be followed by 
an optional C, S,
108144    I, or L indicating that the conversion should be applied to an item 
of type char,
108145    short, int, or long, respectively. Multiple types can be concatenated 
within the
108146    same type_string and multiple −t options can be specified. Output 
lines shall be
108147    written for each type specified in the order in which the type 
specification
108148    characters are specified.

ENVIRONMENT VARIABLES:
108183  LC_CTYPE Determine the locale for the interpretation of sequences of 
bytes of text data as
108184           characters (for example, single-byte as opposed to multi-byte 
characters in
108185           arguments and input files).

EXTENDED DESCRIPTION:
108205  The number of bytes transformed by the output type specifier c may be 
variable depending on
108206  the LC_CTYPE category.

108244  The type specifier character c specifies that bytes shall be 
interpreted as characters specified by
108245  the current setting of the LC_CTYPE locale category. Characters listed 
in the table in XBD
108246  Chapter 5 (on page 113) ('\\', '\a', '\b', '\f', '\n', '\r', '\t', 
'\v') shall be written as
108247  the corresponding escape sequences, except that <backslash> shall be 
written as a single
108248  <backslash> and a NUL shall be written as '\0'. Other non-printable 
characters shall be
108249  written as one three-digit octal number for each byte in the character. 
Printable multi-byte
108250  characters shall be written in the area corresponding to the first byte 
of the character; the two-
108251  character sequence "**" shall be written in the area corresponding to 
each remaining byte in the
108252  character, as an indication that the character is continued. When 
either the −j skip or −N count
108253  option is specified along with the c type specifier, and this results 
in an attempt to start or finish
108254  in the middle of a multi-byte character, the result is 
implementation-defined.


Why, then,
  $ od -tc
  ą
  0000000 304 205  \n
  0000003
?

It appears that od -tc is treated the same as -c,
even though they're naturally different:
108106  XSI  −c  Interpret bytes as characters specified by the current setting 
of the LC_CTYPE
108107           category. Certain non-graphic characters appear as C escapes: 
"NUL=\0",
108108           "BS=\b", "FF=\f", "NL=\n", "CR=\r", "HT=\t"; others appear as 
3-digit octal
108109           numbers.
(and CHANGE HISTORY, Issue 5 says
 "In the description of the −c option, the phrase ``This is equivalent to −t 
c.’’ is deleted.",
 which disambiguates this clumsy spelling as "-c is btowc(), -tc is normal".)

Best,
наб

-- System Information:
Debian Release: 12.0
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: x32 (x86_64)
Foreign Architectures: amd64, i386

Kernel: Linux 6.1.0-2-amd64 (SMP w/2 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, 
TAINT_UNSIGNED_MODULE
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages coreutils depends on:
ii  libacl1      2.3.1-3
ii  libattr1     1:2.5.1-4
ii  libc6        2.36-9
ii  libgmp10     2:6.2.1+dfsg1-1.1
ii  libselinux1  3.4-1+b6

coreutils recommends no packages.

coreutils suggests no packages.

-- no debconf information

Attachment: signature.asc
Description: PGP signature

Reply via email to