#include <libintl.h>
#include <iconv.h>
#include <errno.h>
+#include <relocatable.h>
#include "assertion.h"
#include "hmapx.h"
#include "hash-functions.h"
converter->fromcode = xstrdup (fromcode);
converter->conv = iconv_open (tocode, fromcode);
hmapx_insert (&map, converter, hash);
-
+
/* I don't think it's safe to translate this string or to use messaging
as the convertors have not yet been set up */
if ( (iconv_t) -1 == converter->conv && 0 != strcmp (tocode, fromcode))
conv = create_iconv (to, from);
+ if ( (iconv_t) -1 == conv )
+ return xstrdup (text);
+
do {
const char *ip = text;
result = iconv (conv, (ICONV_CONST char **) &text, &inbytes,
break;
default:
/* should never happen */
+ fprintf (stderr, "Character conversion error: %s\n", strerror (the_error));
NOT_REACHED ();
break;
}
{
#if ENABLE_NLS
setlocale (LC_CTYPE, "");
-#if HAVE_LC_MESSAGES
+#ifdef LC_MESSAGES
setlocale (LC_MESSAGES, "");
#endif
#if HAVE_LC_PAPER
setlocale (LC_PAPER, "");
#endif
- bindtextdomain (PACKAGE, locale_dir);
+ bindtextdomain (PACKAGE, relocate(locale_dir));
textdomain (PACKAGE);
#endif /* ENABLE_NLS */