git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v1 2/2] utf8.c: Enable workaround for iconv under macOS 14/15

From
tboegi@web.de <tboegi@web.de>
Date
Jan 8, 2026, 17:23 UTC
Message-ID
<20260108172330.466146-1-tboegi@web.de>
From: Torsten Bögershausen <torsten.bogershausen@esss.se>

The previous commit introduced a workaround in utf8.c to deal with broken iconv implementations.

It is enabled when
  A MacOS version is used that has a buggy iconv library and
  there is no external library provided (and linked against)
  from neither MacPorts nor Homebrew.
Signed-off-by: Torsten Bögershausen <tboegi@web.de>
---
 Makefile         | 7 +++++++
 config.mak.uname | 1 +
 2 files changed, 8 insertions(+)
diff --git a/Makefile b/Makefile
index b7eba509c6..5a3823bb67 100644
--- a/Makefile
+++ b/Makefile
@@ -1692,6 +1692,7 @@ ifeq ($(uname_S),Darwin)
                 ifeq ($(shell test -d /opt/local/lib && echo y),y)
 			BASIC_CFLAGS += -I/opt/local/include
 			BASIC_LDFLAGS += -L/opt/local/lib
+			HAS_GOOD_LIBICONV = Yes
                 endif
         endif
         ifndef NO_APPLE_COMMON_CRYPTO
@@ -1714,6 +1715,7 @@ endif
 ifdef USE_HOMEBREW_LIBICONV
 ifeq ($(shell test -d $(HOMEBREW_PREFIX)/opt/libiconv && echo y),y)
 	ICONVDIR ?= $(HOMEBREW_PREFIX)/opt/libiconv
+	HAS_GOOD_LIBICONV = Yes
 endif
 endif
 endif
@@ -1859,6 +1861,11 @@ ifndef NO_ICONV
                 endif
 		EXTLIBS += $(ICONV_LINK) -liconv
         endif
+        ifdef NEEDS_GOOD_LIBICONV
+        ifndef HAS_GOOD_LIBICONV
+                BASIC_CFLAGS += -DICONV_RESTART_RESET
+        endif
+        endif
 endif
 ifdef ICONV_OMITS_BOM
 	BASIC_CFLAGS += -DICONV_OMITS_BOM
diff --git a/config.mak.uname b/config.mak.uname
index 38b35af366..3c35ae33a3 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -157,6 +157,7 @@ ifeq ($(uname_S),Darwin)
         endif
         ifeq ($(shell test "$(DARWIN_MAJOR_VERSION)" -ge 24 && echo 1),1)
 		USE_HOMEBREW_LIBICONV = UnfortunatelyYes
+		NEEDS_GOOD_LIBICONV = UnfortunatelyYes
         endif
 
 	# The builtin FSMonitor on MacOS builds upon Simple-IPC.  Both require
-- 
2.50.0.rc0.46.g7014b55638.dirty
Message 1 of 1 in “utf8.c: Enable workaround for iconv under macOS 14/15”
  1. 2/2 utf8.c: Enable workaround for iconv under macOS 14/15tboegi@web.de, Jan 8, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.