octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #53842] Handle m-files with arbitrary characte


From: Markus Mützel
Subject: [Octave-bug-tracker] [bug #53842] Handle m-files with arbitrary character encoding
Date: Sat, 5 May 2018 14:25:54 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0

Follow-up Comment #1, bug #53842 (project octave):

The attached file adds support for converting .m files with any character
encoding to UTF-8 before passing its content to the lexer. The assumed .m file
encoding can be changes with __mfile_encoding__.

I'll also attach "test_iso_8859_15.m" which is encoded with ISO-8859-15
(Western). With it I see the following results in an Octave session starting
with the default .m file encoding "utf-8":

>> test_iso_8859_15
ans = W�hrend Adam lacht, jagen zw�lf Boxk�mpfer Eva quer �ber den
gro�en Sylter Deich - f�r satte 12.345.667,89 �uro
>> __mfile_encoding__
ans = utf-8
>> __mfile_encoding__ ("iso-8859-15")
ans = iso-8859-15
>> clear test_iso_8859_15
>> test_iso_8859_15
ans = Während Adam lacht, jagen zwölf Boxkämpfer Eva quer über den großen
Sylter Deich - für satte 12.345.667,89 €uro


While all non-ASCII characters are initially displayed with the replacement
character, they are correctly read and displayed after the character encoding
was set accordingly.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?53842>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]