Subject: Re: bug#59368: icecat does not honor /etc/timezone starting with 102.3.0.

From: Maxim Cournoyer <[email-masked]>
Date: Tue, 14 Feb 2023 21:45:48 -0500

Hi,

Maxim Cournoyer <[email-masked]> writes:

> Hello,
>
> I've logged a feature request with ICU upstream at
> https://unicode-org.atlassian.net/browse/ICU-22278.
>
> In the meantime, we can apply a patch to our icu4c@71 on master or icu4c
> on core-updates to substitute the zoneinfo file name in
>
> "#define TZZONEINFO      "/usr/share/zoneinfo/""
>
> from the putil.cpp file of ICU.

It seems this was a red herring; patching this reference doesn't help.
I've made the following minimal reproducer to convince myself that ICU
worked in isolation:

--8<---------------cut here---------------start------------->8---
#include <stdio.h>
#include <stdlib.h>

#include <unicode/ucal.h>
#include <unicode/ustring.h>

int main() {
    UChar result[100]; /* char16_t array */
    UErrorCode errorCode = U_ZERO_ERROR;
    char timezone[200];

    ucal_getHostTimeZone(result, 100, &errorCode);

    if (!u_austrncpy(timezone, result, 100)) {
        printf("error: failed to convert UChar array to byte string\n");
        exit(1);
    }

    printf("host timezone: %s\n", timezone);
}
--8<---------------cut here---------------end--------------->8---

Building and running it yields:

--8<---------------cut here---------------start------------->8---
$ make icu-repro && ./icu-repro 
gcc -I ./install/include -L ./install/lib -licudata -licuuc -licui18n \
  -g3 -O0 icu-repro.c -o icu-repro
host timezone: US/Eastern
--8<---------------cut here---------------end--------------->8---

Which is correct for my America/Montreal defined timezone.

To be continued...

-- 
Thanks,
Maxim