$NetBSD: patch-ab,v 1.15 2008/03/02 13:13:48 drochner Exp $

--- src/af/util/xp/ut_iconv.cpp.orig	2005-10-08 12:53:33.000000000 +0200
+++ src/af/util/xp/ut_iconv.cpp
@@ -68,7 +68,8 @@ extern "C" {
 (defined (__MACH__) && defined (__APPLE__)) || \
 (defined(TARGET_OS_MAC) && TARGET_OS_MAC) || \
 defined (__AIX__) || defined(__OpenBSD__) || \
-(defined(__linux__) && defined(__powerpc__) && (__GLIBC__ <= 2) && (__GLIBC_MINOR__ <= 1))
+(defined(__linux__) && defined(__powerpc__) && (__GLIBC__ <= 2) && (__GLIBC_MINOR__ <= 1)) || \
+defined(__NetBSD__) || (defined(_LIBICONV_VERSION) && _LIBICONV_VERSION >= 0x0109 && !defined(__DragonFly__))
 
 #define ICONV_CONST const
 #else
@@ -290,9 +291,11 @@ const char * ucs4Internal ()
 #elif defined(_LIBICONV_H)
   // libiconv seems to prefer UCS-4-INTERNAL to UCS-4BE and UCS-4LE
   return "UCS-4-INTERNAL";
-#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
+#elif defined(__FreeBSD__) || defined(__OpenBSD__)
   // we special case the BSDs since spelling just doesn't work
   return "UCS4";
+#elif defined(__NetBSD__)
+  return "UCS-4";
 #else
   // general case, found by hub and dom
 	if (s_ucs4_internal == 0) 
