diff mbox series

[v2,2/2] man: printf: in 'X, X is a byte under dash

Message ID c7b48630f0f5e9c19bedb8298d591a01c12581af.1660486650.git.nabijaczleweli@nabijaczleweli.xyz (mailing list archive)
State Superseded
Delegated to: Herbert Xu
Headers show
Series [v2,1/2] man: printf: reword to avoid confusion v/v Ar argument[s]/arguments | expand

Commit Message

наб Aug. 14, 2022, 2:19 p.m. UTC
Multiple issues:
  * the encoding is not always ASCII
  * what ASCII code is assigned to я
  * dash isn't internationalised
    (this is nonconformant but out of scope),
    and uses the next /byte/; in a UTF-8 locale:
      $ printf %d\\n \'ą
      196
      $ printf %d\\n \'я
      196
    this is in contrast to POSIX (and bash), which says:
      > If the leading character is a single-quote or double-quote,
      > the value shall be the numeric value in the underlying codeset
      > of the character following the single-quote or double-quote.
    (i.e. mbrtowc(&val, argv[n], ...))

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
---
 src/dash.1 | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/src/dash.1 b/src/dash.1
index 310f34e..38cf020 100644
--- a/src/dash.1
+++ b/src/dash.1
@@ -1552,9 +1552,7 @@  otherwise it is evaluated as a C constant, with the following additions:
 .It
 A leading plus or minus sign is allowed.
 .It
-If the leading character is a single or double quote, the value is the
-.Tn ASCII
-code of the next character.
+If the leading character is a single or double quote, the value of the next byte.
 .El
 .Pp
 The format string is reused as often as necessary until all