Fixed display error with UTF-8 characters

This commit is contained in:
Markus Koch 2017-02-04 20:18:57 +01:00
parent 3c00112efa
commit 5fdc302820
2 changed files with 2 additions and 1 deletions

View File

@ -396,7 +396,7 @@ void mainWindow_entrySelected(GtkWidget *widget, gpointer user_data)
selection = gtk_tree_view_get_selection(mainWindow->entryListView); selection = gtk_tree_view_get_selection(mainWindow->entryListView);
if (gtk_tree_selection_get_selected(selection, &model, &iter)) { if (gtk_tree_selection_get_selected(selection, &model, &iter)) {
gtk_tree_model_get(model, &iter, COL_TEXT, &text, -1); gtk_tree_model_get(model, &iter, COL_TEXT, &text, -1);
gtk_text_buffer_set_text(mainWindow->textBuffer, text, g_utf8_strlen(text, -1)); gtk_text_buffer_set_text(mainWindow->textBuffer, text, strlen(text));
g_free(text); g_free(text);
gtk_tree_model_get(model, &iter, COL_SUMMARY, &summary, -1); gtk_tree_model_get(model, &iter, COL_SUMMARY, &summary, -1);

View File

@ -2,6 +2,7 @@
#define MAINWINDOW_H #define MAINWINDOW_H
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include "mdiary.h" #include "mdiary.h"