# HG changeset patch # User Torsten # Date 1357371309 -3600 # Node ID 80e99730e5d423fd0170b046784a51acee243a5f # Parent f59797321a1b33d70909f00442ccf4b827befd37 gui: set locale to C before starting the interpreter * octave-main-thread.cc(run): set locale to C instead of en_US.UTF-8. * octave-qt-event-listener.cc(current_directory_has_changed): use the correct charset for emitting the signal with a new directory. * main-window.cc(change_current_working_directory,set_current_working_directory) use the correct charset when sending a new directory from the gui to octave. * history-dockwidget.cc(update_history_callback): use the correct chareset for displaying the history. * symbol-information.h: correct charset for displaying value in workspace view. diff -r f59797321a1b -r 80e99730e5d4 libgui/src/history-dockwidget.cc --- a/libgui/src/history-dockwidget.cc Fri Jan 04 14:14:41 2013 -0800 +++ b/libgui/src/history-dockwidget.cc Sat Jan 05 08:35:09 2013 +0100 @@ -200,7 +200,7 @@ std::string entry = command_history::get_entry (i); _history_model->setData (_history_model->index (i), - QString::fromLocal8Bit (entry.data (), entry.size ())); + QString::fromUtf8 (entry.data (), entry.size ())); } // FIXME -- does this behavior make sense? Calling diff -r f59797321a1b -r 80e99730e5d4 libgui/src/main-window.cc --- a/libgui/src/main-window.cc Fri Jan 04 14:14:41 2013 -0800 +++ b/libgui/src/main-window.cc Sat Jan 05 08:35:09 2013 +0100 @@ -286,7 +286,7 @@ if (!directory.isEmpty ()) { - std::string dir = directory.toLocal8Bit ().data (); + std::string dir = directory.toUtf8 ().data (); octave_link::post_event (this, &main_window::change_directory_callback,dir); } } @@ -297,7 +297,7 @@ QFileInfo fileInfo (directory); // check whether this is an existing dir if (fileInfo.exists () && fileInfo.isDir ()) // is dir and exists { - std::string dir = directory.toLocal8Bit ().data (); + std::string dir = directory.toUtf8 ().data (); octave_link::post_event (this, &main_window::change_directory_callback,dir); } } diff -r f59797321a1b -r 80e99730e5d4 libgui/src/octave-adapter/octave-main-thread.cc --- a/libgui/src/octave-adapter/octave-main-thread.cc Fri Jan 04 14:14:41 2013 -0800 +++ b/libgui/src/octave-adapter/octave-main-thread.cc Sat Jan 05 08:35:09 2013 +0100 @@ -38,7 +38,7 @@ void octave_main_thread::run () { - setlocale (LC_ALL, "en_US.UTF-8"); + setlocale (LC_ALL, "C"); emit ready (); diff -r f59797321a1b -r 80e99730e5d4 libgui/src/octave-qt-event-listener.cc --- a/libgui/src/octave-qt-event-listener.cc Fri Jan 04 14:14:41 2013 -0800 +++ b/libgui/src/octave-qt-event-listener.cc Sat Jan 05 08:35:09 2013 +0100 @@ -36,7 +36,7 @@ octave_qt_event_listener::current_directory_has_changed (const std::string& directory) { emit current_directory_has_changed_signal - (QString::fromLocal8Bit (directory.data (), directory.size ())); + (QString::fromUtf8 (directory.data (), directory.size ())); } void diff -r f59797321a1b -r 80e99730e5d4 libgui/src/symbol-information.h --- a/libgui/src/symbol-information.h Fri Jan 04 14:14:41 2013 -0800 +++ b/libgui/src/symbol-information.h Sat Jan 05 08:35:09 2013 +0100 @@ -81,7 +81,11 @@ QString symbol (void) const { return _symbol; } QString class_name (void) const { return _class_name; } - QString value (void) const { return _value; } + QString value (void) const + { + return QString::fromUtf8 (_value.toStdString ().data (), + _value.toStdString ().size ()); + } QString dimension (void) const { return _dimension; } Scope scope (void) const { return _scope; }