commit bebb5af9bb815476cbc0a8068bff2956535f4123
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Mon Mar 8 01:29:03 2010 +0100

    Enable teleinfo support and fix it for UTF-8 support

diff --git a/lecteur.c b/lecteur.c
index dd62d00..deaee4b 100644
--- a/lecteur.c
+++ b/lecteur.c
@@ -100,9 +100,13 @@ XtInputId *id;
 	      kill (pid_teleinfo, SIGKILL);
 	      close (fd_teleinfo);
 	    } else {
+	      char s[8];
+	      int n;
 	      if (mode_emulation == MODE_TELEINFO_FR)
 		c = conversion_teleinfo_fr (c,3);
-	      write (fd_teleinfo, &c, 1);
+	      n = snprintf (s, sizeof (s), "%lc", (unsigned char) c);
+	      if (n != -1)
+		write (fd_teleinfo, s, n);
 	    }
 	}
 	else {
diff --git a/ligne.c b/ligne.c
index 13bdfe3..d4820b8 100644
--- a/ligne.c
+++ b/ligne.c
@@ -172,9 +172,13 @@ XtInputId *id;
 		    selection_mode_emulation (ecran_minitel, "V", NULL);
 		    return;
 	      } else {
+		char s[8];
+		int n;
 		if (mode_emulation == MODE_TELEINFO_FR)
 		  c = conversion_teleinfo_fr (c,1);
-		write (fd_teleinfo, &c, 1);
+		n = snprintf (s, sizeof(s), "%lc", (unsigned char) c);
+		if (n != -1)
+		  write (fd_teleinfo, s, n);
 	      }
 	    } else {
 	      videotexDecode (ecran_minitel, c);
diff --git a/teleinfo.c b/teleinfo.c
index 29c8e58..3b11f48 100644
--- a/teleinfo.c
+++ b/teleinfo.c
@@ -279,7 +279,8 @@ int  m ;
 	  break;
 
       case 0x0e :
-          c = 0xef ;
+          //c = 0xef ;
+          c = 0;
 	break ;
 	  
       case 0x1b :
@@ -310,11 +311,17 @@ XtInputId *id;
     if (read (*fid, &c, 1) == 1)  {
         if (mode_emulation == MODE_TELEINFO_FR)
 	     c = conversion_teleinfo_fr (c,2);
-      
+
 	if (flag_connexion)
 	    write (socket_xteld, &c, 1);
-	else
-	    write (fd_teleinfo, &c, 1);
+	else {
+	    char s[8];
+	    int n;
+
+	    n = snprintf(s, sizeof(s), "%lc", (unsigned char) c);
+	    if (n != -1)
+	      write (fd_teleinfo, s, n);
+	}
     }
 }
 
diff --git a/xtel.c b/xtel.c
index c3dcce0..64771f3 100644
--- a/xtel.c
+++ b/xtel.c
@@ -42,6 +42,8 @@ static char rcsid[] = "$Id: xtel.c,v 1.20 2001/02/11 00:05:13 pierre Exp $";
 #include "pixmaps/xtel.xpm"
 #endif /* NO_XPM */
 
+#include <locale.h>
+
 static Colormap current_cmap;
 static Cursor teleph_cursor;
 static Pixmap pixmap_icone = None;
@@ -446,6 +448,8 @@ char **av;
     int i;
     Widget topLevel;
 
+    setlocale(LC_ALL, "");
+
     if (prototype_xtel == 0) {
 	if (PATCHLEVEL != 0)
 	    printf ("XTEL %d.%d.%d, Emulateur MINITEL/I-MINITEL\n", version_xtel, revision_xtel, PATCHLEVEL);
@@ -639,9 +643,9 @@ char **av;
 
     XtRealizeWidget(topLevel);
 
-    /*
     XtAddCallback (ecran_minitel, XtNmodeCallback, (XtCallbackProc)selection_mode_emulation, (XtPointer)"A");
     XtAddCallback (ecran_minitel, XtNmodefrCallback, (XtCallbackProc)selection_mode_emulation, (XtPointer)"F");
+    /*
     XtAddCallback (ecran_minitel, XtNenregCallback, (XtCallbackProc)enregistre_caractere, (XtPointer)NULL);
     */
     init_xtel ();
