$NetBSD: patch-aa,v 1.5 2019/10/25 09:03:47 kamil Exp $

--- UTF8Tag.cc.orig	2012-06-19 12:40:34.000000000 +0000
+++ UTF8Tag.cc
@@ -34,11 +34,21 @@
 #include <string.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <cstdio>
 
 #include <iconv.h>
 
 #include <sstream>
 
+#if defined(__NetBSD__)
+#include <sys/param.h>
+#if __NetBSD_Prereq__(9,99,17)
+#define NETBSD_POSIX_ICONV 1
+#else
+#define NETBSD_POSIX_ICONV 0
+#endif
+#endif
+
 #include "ErrorLog.h"
 
 CUTF8Tag::CUTF8Tag(const std::string& UTF8Value)
@@ -73,11 +83,15 @@ void CUTF8Tag::Convert()
 		memset(Out,0,m_UTF8Value.length()*4);
 		size_t OutLeft=m_UTF8Value.length()*4;
 
+#if defined(__DragonFly__) || (__linux__) || (defined(__NetBSD__) && NETBSD_POSIX_ICONV)
 		char *InBuff=In;
+#else
+		const char *InBuff=In;
+#endif
 		char *OutBuff=Out;
 
 		std::stringstream NewCodeset;
-		NewCodeset << Codeset << "//TRANSLIT//IGNORE";
+		NewCodeset << Codeset;
 
 		iconv_t Convert=iconv_open(NewCodeset.str().c_str(),"UTF-8");
 		if ((iconv_t)-1!=Convert)
