bug-gnu-libiconv
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gnu-libiconv] difference in iconv for EBCDIC SBCS conversion fr


From: Mike Fulton
Subject: Re: [bug-gnu-libiconv] difference in iconv for EBCDIC SBCS conversion from z/OS OS-provided iconv
Date: Mon, 3 Apr 2023 11:25:17 -0700



On Mon, Apr 3, 2023 at 11:14 AM Bruno Haible <bruno@clisp.org> wrote:
Hi Mike,

> Does this change also generate different TXT
> files for testing, e.g.
> with my 'static patch', I had to do the following patch so that the 'check'
> test would pass.
>
> diff --git a/tests/IBM-1047.TXT b/tests/IBM-1047.TXT
> index d6818cf..9b3d02d 100644
> --- a/tests/IBM-1047.TXT
> +++ b/tests/IBM-1047.TXT
> @@ -19,7 +19,7 @@
>  0x12 0x0012
>  0x13 0x0013
>  0x14 0x009D
> -0x15 0x0085
> +0x15 0x000A
>  0x16 0x0008
>  0x17 0x0087
>  0x18 0x0018
> @@ -35,7 +35,7 @@
>  0x22 0x0082
>  0x23 0x0083
>  0x24 0x0084
> -0x25 0x000A
> +0x25 0x0085
>  0x26 0x0017
>  0x27 0x001B
>  0x28 0x0088

No, the tests/*.TXT files don't change. "make check" passes,
"ICONV_EBCDIC_ZOS_UNIX=1 make check" passes as well.

That's because
  - The iconv _library functions_ don't test the environment variable.
    It's the iconv _program_ which tests it and passes the information
    to the library.
  - The unit tests make use of a program 'table-from' that invokes the
    library, not the iconv program, and therefore works the same way
    regardless of the setting of the environment variable.
Oh. Hm. So that means if a tool uses the iconv() _function_, they will not
have the ability to use the alternate code point _even if_ they set the
environment variable? That doesn't sound ideal. I would think many of
the tools we are porting may be binding libiconv rather than calling it.
In particular 'man' (I will need to check).  
It would seem acceptable if "ICONV_EBCDIC_ZOS_UNIX=1 make check" failed
because the tests expect the default behaviour. 

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]