On Wed, Nov 27, 2024 at 05:29:02PM +0200, Eli Zaretskii wrote: > > and getting the result from the return of the Perl function: > > result_sv = POPs; > > result_ret = SvPVutf8 (result_sv, len); > > OK, thanks. This should work, if we avoid the cases where the caller > allocates memory that Perl is supposed to free, or the other way > around. That's because each side is most probably using a different > implementation of malloc/free.
We already did, but now the split between C code using Gnulib and doing most of the work is separate from the C code doing the interface with Perl in both directions, call to Perl and call from Perl. > If the issue is changing the locale, then it isn't gettext per se, > it's the locale change itself. That is also my guess. > E.g., switching locales on Windows > needs to use Windows locale identifiers, which are similar but > different from Posix ones. I don't know if Cygwin has some feature > whereby it transparently maps one to the other, but if not, that > might be the problem. > I suggest to ask Bruno Haible to help us out. He definitely knows > more than enough about gettext and the possible issues with it on > unusual systems, like Windows, including Cygwin. Ok. In general he reads the ML, but I could ask him directly too. But before, I wanted to see if I can reproduce the issue from the new pure C program to check if the issue is really with C or because of the Perl/C mix. -- Pat