#if defined (FLT_GUI)
 
 #include <m17n-gui.h>
+#include <m17n-misc.h>
 #define PROGNAME "flt-gui"
 
 #elif defined (FLT_OTF)
 
 #include <m17n-flt.h>
+#include <m17n-misc.h>
 #include <otf.h>
 #define PROGNAME "flt-otf"
 
 #else  /* (defined (FLT_PANGO)) */
 
 #include <m17n-flt.h>
+#include <m17n-misc.h>
 #define PANGO_ENABLE_ENGINE
 #define PANGO_ENABLE_BACKEND
 #include <pango/pango.h>
   MText *mt;
   MFLTFont *font;
   int len, i, j;
+  unsigned char *buf;
 
   if (argc < 3)
     {
   font->get_metrics = get_metrics;
   font->drive_otf = drive_otf;
 
-  mt = mconv_decode_stream (msymbol ("utf-8"), stdin);
+  i = 0;
+  buf = malloc (4096);
+  while ((j = fread (buf + i, 1, 4096, stdin)) == 4096)
+    {
+      i += 4096;
+      buf = realloc (buf, i + 4096);
+    }
+  mt = mtext_from_data (buf, i, MTEXT_FORMAT_UTF_8);
   len = mtext_len (mt);
   for (i = 0, j = mtext_character (mt, i, len, '\n'); i < len;
        i = j + 1, j = mtext_character (mt, i, len, '\n'))
       i = j;
     }
   m17n_object_unref (mt);
+  free (buf);
   close_font (font);
   M17N_FINI ();
   return 0;