Index: compdefs.h
--- compdefs.h.orig	2007-03-23 04:51:52 +0100
+++ compdefs.h	2008-04-11 08:12:42 +0200
@@ -4,9 +4,6 @@
 #if defined HAVE_LOCALE_H && defined HAVE_SETLOCALE && defined HAVE_WCSXFRM
 #define LOCALE_SORT_ORDER
 #endif
-#if defined HAVE_LOCALE_H && defined HAVE_SETLOCALE && defined HAVE_LIBINTL_H
-#define LOCALE_GETTEXT
-#endif
 
 #if defined USEUNINUMOK && defined HAVE_UNINUM_NSDEFS_H && defined HAVE_UNINUM_UNINUM_H
 #define USE_UNINUM
Index: configure
--- configure.orig	2008-04-10 08:25:46 +0200
+++ configure	2008-04-11 08:12:42 +0200
@@ -3051,7 +3051,7 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-ltre  $LIBS"
+LIBS="-ltre -lutf8 $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -3114,7 +3114,7 @@
 #define HAVE_LIBTRE 1
 _ACEOF
 
-  LIBS="-ltre $LIBS"
+  LIBS="-ltre -lutf8 $LIBS"
 
 else
   { { echo "$as_me:$LINENO: error: libtre not found. see http://laurikari.net/tre/" >&5
Index: conversions.c
--- conversions.c.orig	2008-03-15 02:09:53 +0100
+++ conversions.c	2008-04-11 08:12:42 +0200
@@ -22,7 +22,7 @@
 #ifdef HAVE_STDINT_H
 #include <stdint.h>
 #endif
-#include <wchar.h>
+#include "utf8/wchar.h"
 #include <stdio.h>
 #ifdef HAVE_UNINUM_UNICODE_H
 #include <uninum/unicode.h>
Index: dstr.c
--- dstr.c.orig	2008-03-15 02:10:28 +0100
+++ dstr.c	2008-04-11 08:12:42 +0200
@@ -22,7 +22,7 @@
 #ifdef HAVE_STDINT_H
 #include <stdint.h>
 #endif
-#include <wchar.h>
+#include "utf8/wchar.h"
 #ifdef HAVE_UNINUM_UNICODE_H
 #include <uninum/unicode.h>
 #else
Index: input.c
--- input.c.orig	2007-10-05 11:00:44 +0200
+++ input.c	2008-04-11 08:12:42 +0200
@@ -25,7 +25,7 @@
 #ifdef HAVE_STDINT_H
 #include <stdint.h>
 #endif
-#include <wchar.h>
+#include "utf8/wchar.h"
 #ifdef LOCALE_GETTEXT
 #include <libintl.h>
 #define _(x) gettext(x)
@@ -60,23 +60,23 @@
   switch (c)
     { 
     case UTF8_NOTENOUGHBYTES:
-      fprintf(fp,gettext("Truncated UTF-8 sequence encountered at record %ld, byte %ld.\n"),
+      fprintf(fp,_("Truncated UTF-8 sequence encountered at record %ld, byte %ld.\n"),
 	      RecordNumber, ByteCnt);
       exit(1);
       break;
     case UTF8_BADINCODE:
-      fprintf(fp,gettext("Invalid UTF-8 code encountered at record %ld, byte %ld.\n"),
+      fprintf(fp,_("Invalid UTF-8 code encountered at record %ld, byte %ld.\n"),
 	      RecordNumber, ByteCnt);
       ExplicateBadUTF8(fp,rp);
       exit(1);
       break;
     case UTF8_BADOUTCODE:
-      fprintf(fp,gettext("Encountered invalid Unicode at record %ld, byte %ld.\n"),
+      fprintf(fp,_("Encountered invalid Unicode at record %ld, byte %ld.\n"),
 	      RecordNumber, ByteCnt);
       exit(1);
       break;
     case UTF8_IOERROR:
-      snprintf(msg,MSGSIZE-1,gettext("Error reading input at record %ld, byte %ld.\n"),
+      snprintf(msg,MSGSIZE-1,_("Error reading input at record %ld, byte %ld.\n"),
 	       RecordNumber,ByteCnt);
       perror(msg);
       exit(1);
Index: misc.c
--- misc.c.orig	2008-04-10 05:15:59 +0200
+++ misc.c	2008-04-11 08:21:42 +0200
@@ -17,6 +17,7 @@
  */
 
 #include "config.h"
+#include "utf8/wchar.h"
 #include "compdefs.h"
 #include <stdlib.h>
 #ifdef HAVE_STDINT_H
@@ -34,7 +35,6 @@
 #define _(x) (x)
 #endif
 #include <time.h>
-#include <wchar.h>
 #include <errno.h>
 #ifndef USEUTF8PROC
 #include <unicode/umachine.h>
@@ -43,16 +43,16 @@
 #include <utf8proc.h>
 #include "unorm.h"
 #endif
-#include <tre/regex.h>
+#include "tre/regex.h"
 #include "key.h"
 #ifdef HAVE_UNINUM_UNICODE_H
-#include <uninum/nsdefs.h>
-#include <uninum/unicode.h>
+#include "uninum/nsdefs.h"
+#include "uninum/unicode.h"
 #else
 #include "unicode.h"
 #endif
 #ifdef HAVE_UNINUM_UNINUM_H
-#include <uninum/uninum.h>
+#include "uninum/uninum.h"
 #endif
 #include "dstr.h"
 #include "exitcode.h"
Index: msort.c
--- msort.c.orig	2008-04-10 08:20:48 +0200
+++ msort.c	2008-04-11 08:12:42 +0200
@@ -50,7 +50,7 @@
 #include <sys/file.h>
 #include <sys/stat.h>
 #include <wctype.h>
-#include <wchar.h>
+#include "utf8/wchar.h"
 #include <time.h>
 #include <errno.h>
 #ifndef USEUTF8PROC
@@ -68,7 +68,7 @@
 #include <uninum/nsdefs.h>
 #include <uninum/uninum.h>
 #endif
-#include <tre/regex.h>
+#include "tre/regex.h"
 
 
 #ifdef HAVE_LONG_LONG
Index: sorts.c
--- sorts.c.orig	2008-04-11 01:16:49 +0200
+++ sorts.c	2008-04-11 08:12:42 +0200
@@ -25,9 +25,9 @@
 #endif
 #include <stdio.h>
 #include <string.h>
-#include <wchar.h>
+#include "utf8/wchar.h"
 #include <wctype.h>
-#include <tre/regex.h>
+#include "tre/regex.h"
 #ifdef HAVE_UNINUM_UNICODE_H
 #include <uninum/unicode.h>
 #else
Index: strs.c
--- strs.c.orig	2008-04-11 01:17:12 +0200
+++ strs.c	2008-04-11 08:12:42 +0200
@@ -25,7 +25,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <stdio.h>
-#include <wchar.h>
+#include "utf8/wchar.h"
 #ifdef HAVE_UNINUM_UNICODE_H
 #include <uninum/unicode.h>
 #else
