$OpenBSD: patch-conversions_c,v 1.6 2007/03/18 17:19:57 martynas Exp $
--- conversions.c.orig	Sun Jun  5 12:50:22 2005
+++ conversions.c	Sun Mar 18 18:26:42 2007
@@ -24,6 +24,7 @@
  *
  */
  
+#include <sys/types.h> 
 #include <string.h>
 #include <iconv.h>
 #include <stdio.h>
@@ -33,6 +34,7 @@
 #include <errno.h>
 #include <libxml/HTMLparser.h>
 #include <langinfo.h>
+#include <md5.h>
 
 /* I have no idea what needs to be defined to get strptime() on glibc.
  * This is stolen from somewhere else and it works for me(tm).
@@ -49,7 +51,6 @@
 #include "interface.h"
 #include "ui-support.h"
 #include "setup.h"
-#include "md5.h"
 #include "digcalc.h"
 
 extern struct entity *first_entity;
@@ -64,17 +65,22 @@ char * iconvert (char * inbuf) {
 	iconv_t cd;							/* Iconvs conversion descriptor. */
 	char *outbuf, *outbuf_first;		/* We need two pointers so we do not lose
 	                                      the string starting position. */
+	char target_charset[64];
 	size_t inbytesleft, outbytesleft;
 
+	(void)strlcpy(target_charset, nl_langinfo(CODESET), sizeof(target_charset));
+
 	/* Take a shortcut. */
-	if (strcasecmp (TARGET_CHARSET, "UTF-8") == 0)
+	if (strcasecmp (target_charset, "UTF-8") == 0)
 		return strdup(inbuf);
 	
 	inbytesleft = strlen(inbuf);
 	outbytesleft = strlen(inbuf);
 
+	(void)strlcat(target_charset, "//TRANSLIT", sizeof(target_charset));
+
 	/* cd = iconv_open(nl_langinfo(CODESET), "UTF-8"); */
-	cd = iconv_open (TARGET_CHARSET, "UTF-8");
+	cd = iconv_open (target_charset, "UTF-8");
 	if (cd == (iconv_t) -1) {
 		return NULL;
 	}
