public inbox for dash@vger.kernel.org
 help / color / mirror / Atom feed
From: "Tom Schwindl" <schwindl@posteo.de>
To: <dash@vger.kernel.org>
Subject: Re: [PATCH v3 2/2] man: printf: in 'X, X is a byte under dash
Date: Fri, 16 Dec 2022 19:16:25 +0000	[thread overview]
Message-ID: <CP3HEJE65V29.14FPDPIQBKE1J@morphine> (raw)
In-Reply-To: <05324b17e76eef2401dbc3ee7d64366134a42d1d.1671063918.git.nabijaczleweli@nabijaczleweli.xyz>

On Thu Dec 15, 2022 at 1:25 AM CET, наб wrote:
> 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], ...))
> ---
>  src/dash.1 | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> 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.

s/of/is/

sounds better to me.

--
Best Regards,
Tom Schwindl

  reply	other threads:[~2022-12-16 19:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-15  0:25 [PATCH v3 1/2] man: printf: reword to avoid confusion v/v Ar argument[s]/arguments наб
2022-12-15  0:25 ` [PATCH v3 2/2] man: printf: in 'X, X is a byte under dash наб
2022-12-16 19:16   ` Tom Schwindl [this message]
2023-01-05  9:45 ` [PATCH v3 1/2] man: printf: reword to avoid confusion v/v Ar argument[s]/arguments Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CP3HEJE65V29.14FPDPIQBKE1J@morphine \
    --to=schwindl@posteo.de \
    --cc=dash@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox