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

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

[Octave-bug-tracker] [bug #64139] character encoding scheme with filerea


From: Guillaume
Subject: [Octave-bug-tracker] [bug #64139] character encoding scheme with fileread
Date: Wed, 3 May 2023 10:11:23 -0400 (EDT)

URL:
  <https://savannah.gnu.org/bugs/?64139>

                 Summary: character encoding scheme with fileread
                   Group: GNU Octave
               Submitter: gyom
               Submitted: Wed 03 May 2023 02:11:21 PM UTC
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Matlab Compatibility
                  Status: None
             Assigned to: None
         Originator Name: Guillaume
        Originator Email: 
             Open/Closed: Open
                 Release: dev
         Discussion Lock: Any
        Operating System: GNU/Linux
           Fixed Release: None
         Planned Release: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Wed 03 May 2023 02:11:21 PM UTC By: Guillaume <gyom>
Using the attached file (UTF-8 Unicode (with BOM) text), I get a different
output with fileread. In Matlab:


>> double(fileread('example.txt'))

ans =

   65279   111    99   116   97   118   101


and in Octave:


octave> double(fileread('example.txt'))

ans =

   239   187   191   111    99   116    97   118   101


If I specify the encoding in Matlab:


>> double(fileread('example.txt','encoding','utf-8'))

ans =

   65279   111    99   116   97   118   101

>> double(fileread('example.txt','encoding','ISO-8859-15'))

ans =

   239   187   191   111    99   116    97   118   101


The documentation says that without a specified encoding, a default encoding
will be used and it might well be that it differs between Octave and Matlab
but how can this be adjusted?






    _______________________________________________________
File Attachments:


-------------------------------------------------------
Date: Wed 03 May 2023 02:11:21 PM UTC  Name: example.txt  Size: 9B   By: gyom

<http://savannah.gnu.org/bugs/download.php?file_id=54697>

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?64139>

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




reply via email to

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