[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gawk] Possible printf %c width multi-byte bug
From: |
Nethox |
Subject: |
Re: [bug-gawk] Possible printf %c width multi-byte bug |
Date: |
Wed, 03 Jul 2013 01:52:03 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130701 Icedove/17.0.7 |
Aharon Robbins, 2013-07-02 21:30:
> Thanks for the report and the test files. With the patch below, it passes.
> I assume it covers the original report as well?
Yes, the test covers both bug reports. And also %s, which had no bug but
I think it was untested for multibyte width and precision.
>> I tried changing ENVIRON["LC_ALL"] from the script itself, but the
>> printf function was unaffected, so the script must be manually called by
>> prepending LC_ALL="C.UTF-8", or I guess with a new specific make target.
>
> That is correct. Changing ENVIRON within the awk program does not affect
> the locale stuff; it's set at startup.
Ok, now I see the initialization at main.c; and the TODO entry talking
about setenv(), which could comprise setlocale() as well.
> Here is the new patch, relative to the gawk-4.1-stable branch in git.
> It includes a modified version of the first patch.
>
> Once you approve, I'll push this.
It works great. All tests pass, including mbprintf4.awk with
LC_ALL="C.UTF-8". Moreover, the output of mbprintf4.awk with LC_ALL="C"
or --characters-as-bytes (-b) remains identical to the unpatched 4.1.0
one, which was already correct (taking into account that processing
multibyte input as bytes results in human-nonreadadable text).
> Thanks,
>
> Arnold
Thank you for the programming and maintenance work.