bugGNU Octave - Bugs: bug #45597, GUI Editor should use ANSI text...

 
 

bug #45597: GUI Editor should use ANSI text encoding under Windows

Submitter:  Hartmut <hardy>
Submitted:  Tue 21 Jul 2015 06:45:53 PM UTC
   
 
Category:  GUI Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  Fixed Assigned to:  ttl
Originator Name:  Open/Closed:  * Closed
Release:  * 4.0.0 Operating System:  * Microsoft Windows
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sun 29 Nov 2015 09:34:37 AM UTC, comment #7: 

I am closing this report, as this issue is fixed. Further discussion on file encoding can be found under bug #45688.

Torsten Lilge <ttl>
Group Member
Wed 25 Nov 2015 07:27:11 PM UTC, comment #6: 

Here the pronounced patch:
http://hg.savannah.gnu.org/hgweb/octave/rev/7d6f38541902
SYSTEM encoding is default on windows, UTF-8 otherwise.

Torsten Lilge <ttl>
Group Member
Mon 23 Nov 2015 08:37:41 PM UTC, comment #5: 

Okay, I have to admit, that I wanted to change the default on all platforms :-). When there are no other objections (from Mac users?) I will set the default encoding to the system default on windows and to UTF-8 otherwise.

Torsten Lilge <ttl>
Group Member
Mon 23 Nov 2015 08:05:44 PM UTC, comment #4: 

Yes, I see the same behavior unter Ubuntu Linux (14.04):

  • When I open an ISO8859-1 file with umlauts, those characters are just omitted with Octave 4.0.1+ (default encoding setting = "system default") currently.
  • When I open an ISO8859-1 file with umlauts, I get funny diamond shaped question marks instead of the umlauts with Octave 4.0.1+ (explicit encoding setting to "UTF-8") currently.
  • Wen I open the samme ISO8859-1file with umlauts in Octave 4.0.0 release, then I also get funny diamond shaped question marks instead of the umlauts.


note: I just now realise, have I misunderstood you? Do you maybe suggest to set the default encoding ONLY for Linux to UTF-8? In this case I would fully agree :) It's better so see funny diamond shaped question marks (then at least you know that some encoding error just destroyed your umlauts), instead of silently dropping several text characters.

...The following text was written when I still thought that you wanted to change the default encoding to UTF-8 BOTH for Linux and Windows:...

Nevertheless I DO like the current behavior a lot - not the funny (but exotic) behavior described above, but the fact that:

  • Under Linux OS I can open any m file that was created (under Linux) with Octave 3.8.2 release and Octave 4.0.0 release, and I do see all umlauts displayed properly.
  • Under Windows OS I can open any mm file that was created (under Windows) with Matlab, with Octave 3.8.2 [with Octave 4.0.0 I am not sure at the moment, but I could check], and I do see all umlauts displayed properly.


I think the use case that someone save an m file under one operating system, and then opens the saved m file under a different operating system is quite rare and exotic. Whereas I think that the use case that someone under Windows wants to open an m file that was created under Matlab happens (hopefully!) quite often.

This is why I do NOT like the idea of setting the default encoding for Ubuntu AND windows back to UTF8.

Hartmut <hardy>
Mon 23 Nov 2015 07:35:14 PM UTC, comment #3: 

Thanks for testing!

I am thinking about pushing a cset that changes the default to UTF-8 since the system default under Ubuntu just drops special characters like umlauts when reading a ISO8859-1 file. When using UTF-8 at least some non-printable characters are shown.

Can you reproduce this behavior in ubuntu?

Torsten Lilge <ttl>
Group Member
Mon 23 Nov 2015 07:20:27 PM UTC, comment #2: 

Thanks for fixing this.

I have compiled the current "default" branch of Octave

  • under (Ubuntu) linux, and
  • with mxe-octave, and then using the resulting binaries under Windows 7.


These are the resulting encodings I see, when I save an m file from the gui editor (not changing the default settings):

  • Ubuntu + Octave 4.0.1+ -> UTF-8
  • Win 7 + Octave 4.0.1+ -> ISO8859-1


Under Windows 7 I have also loaded an m file with several umlauts (generated under Win7 + Octave 3.8.2 GUI) into the Octave 4.0.1+ editor, and the result look alright. And I've teste it vice versa, saving the umlauts in Octave 4.0.1+ and afterwards opening the file in Octave 3.8.2. Both looked alright.

So I would consider this issue to be resolved with this patch :)

Hartmut <hardy>
Sat 21 Nov 2015 02:41:02 PM UTC, comment #1: 

I have pushed changeset
http://hg.savannah.gnu.org/hgweb/octave/rev/83611b387bc5
(default branch). The encoding for reading or saving an editor file is the one that suits best to the system locale. Moreover, it can be changed in the settings dialog. A detection or conversion of encodings it not (yet) implemented.

Torsten Lilge <ttl>
Group Member
Tue 21 Jul 2015 06:45:53 PM UTC, original submission:  

On a Windows system the GUI Editor of Octave changed the code pages for the text encoding from version 3.8.2 to 4.0.0.

Here is how to reproduce this:

  • use Windows (I had Win7)
  • Create a new and empty document in the GUI edidtor of Octave.
  • enter some special characters, for example umlauts like ÖÄÜ.
  • save the small document as m file
  • Have a look at the encoding of the generated m file


I observed the follwing encodings:

  • Win7 + Octave 3.8.2-3 -> ANSI
  • Win7 + Octave 4.0.0   -> UTF8
  • Win7 + Matlab (2013b) -> ANSI
  • Ubuntu + Octave 3.8.2 -> UTF8
  • Ubuntu + Octave 4.0.0 -> UTF8


The resulting problem is: If you open an m file that was created by Matlab (or Octave 3.8.2) on a Windows OS with the current Octave 4.0.0, then all umlauts are displayed unreadable :(

This was working etter with (unofficial MXE-3) Windows release of Octave 3.8.2

Could be change the text encoding back to "ANSI" for the Windows release of the next Octave version?

Hartmut <hardy>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by ttl (Posted a comment)
  • -email is unavailable- added by hardy (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-11-29 ttl StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2015-11-21 ttl StatusNone Ready For Test
        Assigned toNone ttl

    Back to the top

    Powered by Savane 3.13-5884.
    Corresponding source code