Commit badf62ba authored by claes's avatar claes

Conversion ISO to UTF8 in textfields

parent e2255584
/*
* Proview $Id: wb_watt_gtk.cpp,v 1.4 2007-02-06 10:06:41 claes Exp $
* Proview $Id: wb_watt_gtk.cpp,v 1.5 2007-02-06 13:22:47 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -114,7 +114,10 @@ void WAttGtk::change_value( int set_focus)
gtk_text_buffer_delete( cmd_scrolled_buffer, &start_iter, &end_iter);
gtk_text_buffer_get_start_iter( cmd_scrolled_buffer, &start_iter);
gtk_text_buffer_insert( cmd_scrolled_buffer, &start_iter, value, -1);
char *textutf8 = g_convert( value, -1, "UTF-8", "ISO8859-1", NULL, NULL, NULL);
gtk_text_buffer_insert( cmd_scrolled_buffer, &start_iter, textutf8, -1);
g_free( textutf8);
// Select the text
// gtk_text_buffer_get_start_iter( cmd_scrolled_buffer, &start_iter);
......@@ -122,9 +125,11 @@ void WAttGtk::change_value( int set_focus)
// gtk_text_buffer_select_range( cmd_scrolled_buffer, &start_iter, &end_iter);
}
else {
char *textutf8 = g_convert( value, -1, "UTF-8", "ISO8859-1", NULL, NULL, NULL);
gint pos = 0;
gtk_editable_delete_text( GTK_EDITABLE(cmd_input), 0, -1);
gtk_editable_insert_text( GTK_EDITABLE(text_w), value, strlen(value), &pos);
gtk_editable_insert_text( GTK_EDITABLE(text_w), textutf8, strlen(textutf8), &pos);
g_free( textutf8);
// Select the text
gtk_editable_set_position( GTK_EDITABLE(cmd_input), -1);
......
/*
* Proview $Id: wb_wtt_gtk.cpp,v 1.9 2007-02-06 10:06:41 claes Exp $
* Proview $Id: wb_wtt_gtk.cpp,v 1.10 2007-02-06 13:22:47 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -726,9 +726,11 @@ void WttGtk::open_change_value()
gtk_widget_grab_focus( cmd_input);
if ( value) {
char *textutf8 = g_convert( value, -1, "UTF-8", "ISO8859-1", NULL, NULL, NULL);
gint pos = 0;
gtk_editable_delete_text( GTK_EDITABLE(cmd_input), 0, -1);
gtk_editable_insert_text( GTK_EDITABLE(cmd_input), value, strlen(value), &pos);
gtk_editable_insert_text( GTK_EDITABLE(cmd_input), textutf8, strlen(textutf8), &pos);
g_free( textutf8);
// Select the text
gtk_editable_set_position( GTK_EDITABLE(cmd_input), -1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment