Non-English characters issue

490 views
Skip to first unread message

joah...@gmail.com

unread,
May 9, 2013, 1:52:51 AM5/9/13
to octav...@googlegroups.com
Hello,
I have tested the Octave-UPM on non-English (Korean) MS-Window system and encountered a problem.
The non-English Unicode file name and directory name usually used in MS-Window systems causes some problems.
I attached three files for your information.
As shown in the attached u1.png and u2.png, the non-English Unicode characters ("한글") are corrupted oddly in current directory, workspace, and command window.
U1.png was captured after executing the script in the Editor window by pressing the run icon.
In this case, the script runs well but the string shown in the current directory and workspace window is corrupted.
U2.png was captured after changing the current directory into a directory with non-English name.
In this case, the current directory shown in lower-left side is changed correctly, but the command window gives error messages.
Finally, U3.png was captured after ls command was executed. The location of prompt was changed abnormally and became normal after pressing enter key several times.
I hope the Octave-UPM becomes more useful for many users using non-English MS-Window system.
Thank you for your contributions.

Best regards,
Sung Deuk Kim

u1.png
u2.png
u3.png

Israel Herraiz

unread,
May 23, 2013, 6:27:43 AM5/23/13
to joahekim, octave-upm
Excerpts from joahekim's message of Thu May 09 07:52:51 +0200 2013:
Thanks for reporting this.

I don't know if I will be able to fix it easily. As far as I can tell,
Qt can use UTF-8, so the problem with the workspace and current
directory box can be fixed. But I am not sure about the problem in the
command window.

Can you test the same using the command line only? (there is a
launcher in the programs menu)

Would you be able to compile Octave UPM from the sources? If you can
do that, I can try to give you some patches to test if they
work. Otherwise, it is going to be very hard to test in my computer.

Thanks!

Israel

Jorge Rocha

unread,
Oct 1, 2013, 10:28:41 AM10/1/13
to octav...@googlegroups.com, joahekim
Hi,

My Octave-UPM has the right encoding in the command window, but not on the rest of the interface.
So I am able to write accented characters on the command line, but in every other interface widget the text is not correctly rendered (current directory, command history, workspace). See the attachment.

But the major problem is the editor. Soon as I type the first non ascii character, the application crashes :-(
To replicate the problem, I just need to create a new file, and then write on the editor:
# Funç
Soon as I write the 'ç' the application craches.
Using gdb to run the application does not provide useful information about the crash. It says:
Program received signal SIGSEGV, Segmentation fault.
0xb5853967 in QCoreApplication::notifyInternal(QObject*, QEvent*) ()
   from /usr/lib/i386-linux-gnu/libQtCore.so.4

I'm using Ubuntu 12.04, Octave UPM R8.2 (octave-upm 3.6.2-R8.2~precise16).

Regards,

Jorge
Captura de ecra de 2013-10-01 15:13:58.png

Israel Herraiz

unread,
Oct 1, 2013, 1:03:08 PM10/1/13
to Jorge Rocha, octave-upm, joahekim
Excerpts from Jorge Rocha's message of Tue Oct 01 16:28:41 +0200 2013:
> My Octave-UPM has the right encoding in the command window, but not on the
> rest of the interface.
> So I am able to write accented characters on the command line, but in every
> other interface widget the text is not correctly rendered (current
> directory, command history, workspace). See the attachment.
>
> But *the major problem is the editor*. Soon as I type the first non ascii
> character, the application crashes :-(
> To replicate the problem, I just need to create a new file, and then write
> on the editor:
> # Funç
> Soon as I write the 'ç' the application craches.
> Using gdb to run the application does not provide useful information about
> the crash. It says:
> Program received signal SIGSEGV, Segmentation fault.
> 0xb5853967 in QCoreApplication::notifyInternal(QObject*, QEvent*) ()
> from /usr/lib/i386-linux-gnu/libQtCore.so.4
>
> I'm using Ubuntu 12.04, Octave UPM R8.2 (octave-upm 3.6.2-R8.2~precise16).

The encoding problems that were reported in this thread are actually
specific to Windows.

In GNU/Linux, I don't have any problem with encoding in my ArchLinux
system. In a Linux Mint virtual machine that use the Ubuntu packages,
I cannot reproduce that bug either.

I have also tried with an Ubuntu 12.04 machine, with octave-upm
3.6.2-R8.2~precise16, and I am able to write the "ç" character (and
others) both in the terminal and the editor.

I can reproduce some of the behavior with the current directory widget
in the toolbar. It does not correctly shows the characters, and you
cannot change to a directory with non-ascii characters using the
GUI. However, I cannot make the application crash.

What encoding are you using in your system? Could you report the
output of "locale" in your system? Could you change the locale to
"en_US.UTF-8" and check again?

Regards,
Israel

Jorge Rocha

unread,
Oct 8, 2013, 8:06:09 AM10/8/13
to octav...@googlegroups.com, Jorge Rocha, joahekim
Hi,

Compiling last revision (#388, Oct 8, 2013) already with the lines:
  QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
  QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
  QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8"));
works great! The characters in the interface are encoded correctly in Ubuntu, LANG=pt_PT.UTF-8
Thanks both Israel and Sung Deuk Kim.

Meanwhile, I'm trying to debug the segmentation fault that happens when accented characters are written in the editor.

Regards,

Jorge
Reply all
Reply to author
Forward
0 new messages