bugGNU Octave - Bugs: bug #58717, Inputting Chinese Characters and...

 
 

bug #58717: Inputting Chinese Characters and Resizing windows will cause a mess

Submitted by:  None
Submitted on:  Tue 07 Jul 2020 02:19:01 AM UTC  
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Confirmed Assigned to:  None
Originator Name:  Billchenchina Originator Email:  -email is unavailable-
Open/Closed:  Open Release:  5.2.0
Operating System:  Microsoft Windows

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Thu 16 Jul 2020 06:56:46 AM UTC, comment #4: 

@Kai: I wouldn't consider your approach a hack. The used font must provide glyphs for all used characters. Otherwise, they cannot be rendered.

Markus Mützel <mmuetzel>
Project Member
Thu 16 Jul 2020 06:38:41 AM UTC, comment #3: 

If you are using the "qt" toolkit, there is a little "hackaround":

x = -10:.2:10;
y = sin (x);
plot (x, y);
title ("你好", "FontName", "IPAGothic");

This must be run from a script or function, as the terminal is sometimes reluctant to accept non-ASCII characters.  You can of course choose any other installed font "IPAGothic" supporting Chinese characters.

The "FontName" attribute can be set for many plotting widgets.

Kai Torben Ohlhus <siko1056>
Project Member
Thu 16 Jul 2020 05:51:41 AM UTC, comment #2: 

By the way, is there any solution for CJK text render? Octave is returning these warning when rendering Chinese String 你好

warning: text_renderer: skipping missing glyph for character '6d63'
warning: text_renderer: skipping missing glyph for character '72b2'
warning: text_renderer: skipping missing glyph for character '30bd'

Thanks!

Tianyu Chen <billchenchina>
Tue 07 Jul 2020 08:24:37 AM UTC, comment #1: 

There are a few similar open bug reports: e.g. bug #58637, bug #47571.
Also there is bug #56224. Maybe something similar is happening here. One byte of the (UTF-8 encoded) character might be interpreted as a command that completely breaks the input. (At least this is what I guess is happening.)

We are using the Windows console behind the scenes to provide the command window widget on Windows. Unfortunately, the Windows console has problems handling UTF-8 (or any Unicode fwiw).
I've read somewhere that MS is considering the console to be legacy code (can't find the source at the moment). So there is probably little hope that they are going to invest much effort to improve that situation.

One thing that Octave might be able to do is to write our own (cross-platform) widget for the command window. However, that is a major project (and development in that direction seems to have stalled).
The current implementation works good enough on non-Windows platforms (which use a different model that doesn't work on Windows). Most active developers use Linux...

I guess what I wanted to say is: I can confirm that on Windows the command window doesn't work correctly for international characters. But unfortunately I don't know of a quick fix that would fix all the problems.

IIRC, we are using file handles to communicate with the console. Maybe if we wrote a wrapper that forwarded those streams to the Windows console API (ReadConsoleW and WriteConsoleW), some of the issues would be alleviated.
But all time and effort invested in this now might be in vain if we switched to a cross-platform widget in the future...

Markus Mützel <mmuetzel>
Project Member
Tue 07 Jul 2020 02:19:01 AM UTC, original submission:  

Hi, I'm a Chinese user and I'm using GNU Octave 5.2.0. When I tried to input any Chinese character into GUI(Whether inputting as a string or comment), Octave doesn't work at all.

For example, I tried to input `s = "你好";`, the command prompt doesn't respond. When I tried to resize the window then, it turned up to a mess(See Screenshot below)

The CLI doesn't work as well.

------

I'll try in Debian to see if this bug exists later.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #49444:  Octave_GUI_2020-07-07_10-16-56.png added by None (59KiB - image/png)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by siko1056 (Posted a comment)
  • -email is unavailable- added by billchenchina (Posted a comment)
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-07-07 mmuetzel StatusNone => Confirmed
    2020-07-07 None Attached File- => Added Octave_GUI_2020-07-07_10-16-56.png, #49444

    Back to the top


    Powered by Savane 3.5