bugGNU Octave - Bugs: bug #59572, "system" doesn't work...

 
 

bug #59572: "system" doesn't work with non-ASCII characters on Windows

Submitted by:  Markus Mützel <mmuetzel>
Submitted on:  Sun 29 Nov 2020 04:52:02 PM UTC  
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  None Assigned to:  None
Originator Name:  Open/Closed:  Open
Release:  dev 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.

 

Fri 04 Dec 2020 05:38:23 PM UTC, comment #3: 

The code paths for the three different use cases of system are quite different. So I guess we can fix them one at a time.
I pushed the first two patches here:
https://hg.savannah.gnu.org/hgweb/octave/rev/f873857f5f86
https://hg.savannah.gnu.org/hgweb/octave/rev/1024bc946c95

Still don't know how to start for the third one...

Markus Mützel <mmuetzel>
Project Member
Sun 29 Nov 2020 05:58:15 PM UTC, comment #2: 

Attached is another (independent) patch for non-ASCII characters in commands in asynchronous mode on Windows.

I still don't know how to fix the synchronous mode with output.
The commands themselves seem to be executed using a pipe. That already works with non-ASCII characters. But if the output contains non-ASCII characters, it is broken currently.

The key is probably to understand how `iprocstream` works in `run_command_and_return_output` here:
https://hg.savannah.gnu.org/hgweb/octave/file/54509b7fddd3/libinterp/corefcn/toplev.cc#l104

Can it just inherit from `std::wios` instead of `std::ios` and everything will fall in place correctly? If that is the way to go, that would probably mean a lot of duplicated classes.
Is there a better way to implement this?

(file #50362)

Markus Mützel <mmuetzel>
Project Member
Sun 29 Nov 2020 04:55:05 PM UTC, comment #1: 

Attached the patch which should fix "system" in synchronous mode without output.

(file #50361)

Markus Mützel <mmuetzel>
Project Member
Sun 29 Nov 2020 04:52:02 PM UTC, original submission:  

The function "system" doesn't work on Windows if the command that should be executed contains non-ASCII characters.

I have a partial fix almost ready that should fix this in synchronous mode without output.

I believe I also understand what is necessary to get this to work for asynchronous calls.

But I'm stuck when it comes to understanding the synchronous case with output. I don't know how to fix getting output including non-ASCII characters.
Is that done in the iprocstream class? If so, how? Any help would be appreciated.

I'll upload the partial changeset as soon as I have a bug number.

Markus Mützel <mmuetzel>
Project Member

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #50361:  bug59572_wsystem.patch added by mmuetzel (3KiB - text/plain)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mmuetzel (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-11-29 mmuetzel Attached File- => Added bug59572_CreateProcessW.patch, #50362
        Summary"system" doesn't work for non-ASCII characters on Windows => "system" doesn't work with non-ASCII characters on Windows
    2020-11-29 mmuetzel Attached File- => Added bug59572_wsystem.patch, #50361

    Back to the top


    Powered by Savane 3.5