diff --git a/src/libsushi/sushi-text-loader.c b/src/libsushi/sushi-text-loader.c
index e566e09..ad08e91 100644
--- a/src/libsushi/sushi-text-loader.c
+++ b/src/libsushi/sushi-text-loader.c
@@ -163,6 +163,7 @@ load_contents_async_ready_cb (GObject *source,
   SushiTextLoader *self = user_data;
   GError *error = NULL;
   gchar *contents;
+  const gchar *end;
   GtkSourceLanguage *language = NULL;
 
   g_file_load_contents_finish (G_FILE (source), res,
@@ -177,6 +178,14 @@ load_contents_async_ready_cb (GObject *source,
     return;
   }
 
+  if (!g_utf8_validate (contents, -1, &end)) {
+    /* FIXME: we need to report the error */
+    g_print ("Can't load the text file as it has invalid characters");
+    g_free (contents);
+
+    return;
+  }
+
   gtk_source_buffer_begin_not_undoable_action (self->priv->buffer);
   gtk_text_buffer_set_text (GTK_TEXT_BUFFER (self->priv->buffer), contents, -1);
   gtk_source_buffer_end_not_undoable_action (self->priv->buffer);
