Geoff Clare wrote in
 <20220524091849.GC25920@localhost>:
 |Bruno Haible wrote, on 12 May 2022:
 |>
 |> https://posix.rhansen.org/p/gettext_draft
 |> Line 573
 |> 
 |> "The application shall ensure that the codeset argument, if non-empty, \
 |> is a
 |>  valid codeset name that can be used as the tocode argument of the \
 |>  iconv_open()
 |>  function."
 |> 
 |> This is not the only requirement. We also need the requirement that \
 |> the NUL
 |> character of ASCII maps to a single NUL byte in the codeset. Otherwise \
 |> the
 |> iconv() processing inside gettext() is likely to malfunction.
 |> 
 |> Suggestion: Change
 |> "... iconv_open() function."
 |> to
 |> "... iconv_open() function, and that the NUL character corresponds to a
 |>  single NUL byte in codeset. So, the codeset may not be, for example,
 |>  "UCS-2", "UTF-16", "UTF-16BE", "UTF-16LE", "UCS-4", "UTF-32", "UTF-32BE"\
 |>  ,
 |>  "UTF-32LE", "UTF-7"."
 |
 |In today's call we made changes along the lines you suggest. Please
 |check the updated etherpad to see if they achieve what you wanted.

But can it be any more generic than

  that in the codeset it specifies, the NUL character corresponds
  to a single NUL byte.

that is the question.

  I personally never liked gettext().  I just did something with
  a dictionary, and used block-injecting C preprocessor macros for
  calls, because the ({ static size_t gen_cnt;.. })
  right-hand-side extension never made it into a standard, and it
  is wasteful to call functions for nothing, especially when the
  gen_cnt will be set only once and never change in "real life".

  I find that "setlocale() may invalidate the string" painful,
  because many functions of the C library do not have _l() variants
  that could work with a uselocale() object.  Just think about the
  scanf() that is used so often, or strtol(): you cannot even
  convert a number by standard means.
  If i were to design this, i would center on bindtextdomain(),
  and just keep it going.
  That is of course easier said than done, as only existing
  behaviour is streamlined and standardized.

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)

    • Re: POSIX bind_... Bruno Haible via austin-group-l at The Open Group
      • Re: POSIX b... Steffen Nurpmeso via austin-group-l at The Open Group
        • Re: POS... Harald van Dijk via austin-group-l at The Open Group
          • Re:... Steffen Nurpmeso via austin-group-l at The Open Group
            • ... Harald van Dijk via austin-group-l at The Open Group
              • ... Steffen Nurpmeso via austin-group-l at The Open Group
              • ... Harald van Dijk via austin-group-l at The Open Group
              • ... Steffen Nurpmeso via austin-group-l at The Open Group
              • ... Steffen Nurpmeso via austin-group-l at The Open Group
  • Re: POSIX bind_textd... Geoff Clare via austin-group-l at The Open Group
    • Re: POSIX bind_... Steffen Nurpmeso via austin-group-l at The Open Group
      • Re: POSIX b... Geoff Clare via austin-group-l at The Open Group
        • Re: POS... Steffen Nurpmeso via austin-group-l at The Open Group
    • Re: POSIX bind_... Bruno Haible via austin-group-l at The Open Group

Reply via email to