{"thread":{"id":"64749","subject":"[PATCH v1 2/2] utf8.c: Enable workaround for iconv under macOS 14/15","startedAt":"2026-01-08T17:23:40Z","lastAt":"2026-01-08T17:23:40Z","messageCount":1,"participants":["tboegi@web.de"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"533292","messageId":"20260108172330.466146-1-tboegi@web.de","threadId":"64749","inReplyTo":null,"subject":"[PATCH v1 2/2] utf8.c: Enable workaround for iconv under macOS 14/15","fromName":"","fromEmail":"tboegi@web.de","sentAt":"2026-01-08T17:23:30Z","receivedAt":"2026-01-08T17:23:40Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"From: Torsten Bögershausen <torsten.bogershausen@esss.se>\n\nThe previous commit introduced a workaround in utf8.c to deal\nwith broken iconv implementations.\n\nIt is enabled when\n  A MacOS version is used that has a buggy iconv library and\n  there is no external library provided (and linked against)\n  from neither MacPorts nor Homebrew.\n\nSigned-off-by: Torsten Bögershausen <tboegi@web.de>\n---\n Makefile         | 7 +++++++\n config.mak.uname | 1 +\n 2 files changed, 8 insertions(+)\n\ndiff --git a/Makefile b/Makefile\nindex b7eba509c6..5a3823bb67 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1692,6 +1692,7 @@ ifeq ($(uname_S),Darwin)\n                 ifeq ($(shell test -d /opt/local/lib && echo y),y)\n \t\t\tBASIC_CFLAGS += -I/opt/local/include\n \t\t\tBASIC_LDFLAGS += -L/opt/local/lib\n+\t\t\tHAS_GOOD_LIBICONV = Yes\n                 endif\n         endif\n         ifndef NO_APPLE_COMMON_CRYPTO\n@@ -1714,6 +1715,7 @@ endif\n ifdef USE_HOMEBREW_LIBICONV\n ifeq ($(shell test -d $(HOMEBREW_PREFIX)/opt/libiconv && echo y),y)\n \tICONVDIR ?= $(HOMEBREW_PREFIX)/opt/libiconv\n+\tHAS_GOOD_LIBICONV = Yes\n endif\n endif\n endif\n@@ -1859,6 +1861,11 @@ ifndef NO_ICONV\n                 endif\n \t\tEXTLIBS += $(ICONV_LINK) -liconv\n         endif\n+        ifdef NEEDS_GOOD_LIBICONV\n+        ifndef HAS_GOOD_LIBICONV\n+                BASIC_CFLAGS += -DICONV_RESTART_RESET\n+        endif\n+        endif\n endif\n ifdef ICONV_OMITS_BOM\n \tBASIC_CFLAGS += -DICONV_OMITS_BOM\ndiff --git a/config.mak.uname b/config.mak.uname\nindex 38b35af366..3c35ae33a3 100644\n--- a/config.mak.uname\n+++ b/config.mak.uname\n@@ -157,6 +157,7 @@ ifeq ($(uname_S),Darwin)\n         endif\n         ifeq ($(shell test \"$(DARWIN_MAJOR_VERSION)\" -ge 24 && echo 1),1)\n \t\tUSE_HOMEBREW_LIBICONV = UnfortunatelyYes\n+\t\tNEEDS_GOOD_LIBICONV = UnfortunatelyYes\n         endif\n \n \t# The builtin FSMonitor on MacOS builds upon Simple-IPC.  Both require\n-- \n2.50.0.rc0.46.g7014b55638.dirty\n\n"}]}