bugGNU Octave - Bugs: bug #50404, Double-byte characters lead to...


bug #50404: Double-byte characters lead to incorrect line wrap in Command Window

Submitted by:  Mingye Wang <arthur2e5>
Submitted on:  Sat Feb 25 23:47:33 2017  
Category: GUISeverity: 3 - Normal
Priority: 5 - NormalItem Group: None
Status: NoneAssigned to: None
Originator Name: Open/Closed: Open
Release: 4.2.0Operating System: Microsoft Windows

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

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


Tue Feb 28 14:01:43 2017, comment #3:

I re-worded the title. Are you OK with that change?

I am not aware of any recent bug fixes that could affect that particular issue. But could you please try with the recently released Octave 4.2.1 whether the issue still persists?
Could you also please try if the same happens on the CLI? You might have to set the codepage to UTF-8 first with the following command:

Markus Mützel <mmuetzel>
Project Member
Mon Feb 27 18:54:15 2017, comment #2:

The "double column character" I referred to means characters that yield a column count of 2 when queried with, e.g. wcwidth(L'著'). The "terminal window" I was talking about refers to the "Command Window" (oops) tab in the GUI. I am running Windows 10 build 15042, if that helps too.

The code should be correct by itself. I have swapped fonts to Consolas and was able to reproduce the bug, so it doesn't appear to have anything to do which my latin+CJK monospace font...

A related thing to test for is zero-width characters like zwsp, but it doesn't appear to cause any troubles on my copy of Octave 4.2.0.

Mingye Wang <arthur2e5>
Sun Feb 26 15:50:01 2017, comment #1:

I cannot duplicate the problem in Octave 4.2.1 and 4.2.0 on Windows 10.

Saving your example function to "faa.m" and executing it yields the following:

So nothing seems to be wrong here.
I don't know what a "double column character" is. So something might have gone wrong during copy-pasting your example code.
Could you please attach your example code here to make sure, we are trying the same?

Markus Mützel <mmuetzel>
Project Member
Sat Feb 25 23:47:33 2017, original submission:

Running the following function in Octave 4.2.0 results in a messed-up terminal window:

The terminal alignment appears ruined by the double-column character '著', with the input prompt ">>" shifted to the right side of the screen. Stacking multiple such characters with strings like '世界' causes the ">>" to gradually shift back to the left.

Mingye Wang <arthur2e5>


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

Attach File(s):

Attached Files
file #39833:  OctaveAlign.PNG added by arthur2e5 (72kB - image/png)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by mmuetzel (Posted a comment)
  • -unavailable- added by arthur2e5 (Submitted the item)

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

    Only project members can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue Feb 28 14:01:43 2017mmuetzelSummaryTerminal Window seems unable to handle multi-column characters=>Double-byte characters lead to incorrect line wrap in Command Window
    Sat Feb 25 23:47:33 2017arthur2e5Attached File-=>Added OctaveAlign.PNG, #39833

    Back to the top

    Powered by Savane 3.1-cleanup1