diff libinterp/corefcn/oct-stream.cc @ 26705:c13143821eef

Add front-end support for encodings in "fopen" (bug #55452). * file-io.cc (Ffopen): Add support for input and output argument "encoding". (do_stream_open): Check if encoding is valid. * oct-stream.cc (stream_list::get_info): Return encoding. * io.tst (fopen): Adapt for new syntax. Add test for writing and reading with specified encoding.
author Markus Mützel <markus.muetzel@gmx.de>
date Sat, 09 Feb 2019 17:41:48 +0100
parents 29ea2369971d
children ccea3574f36b
line wrap: on
line diff
--- a/libinterp/corefcn/oct-stream.cc	Sat Feb 09 09:44:28 2019 -0800
+++ b/libinterp/corefcn/oct-stream.cc	Sat Feb 09 17:41:48 2019 +0100
@@ -7484,7 +7484,7 @@
 
   string_vector stream_list::get_info (int fid) const
   {
-    string_vector retval (3);
+    string_vector retval (4);
 
     if (fid < 0)
       return retval;
@@ -7509,6 +7509,7 @@
     retval(0) = os.name ();
     retval(1) = stream::mode_as_string (os.mode ());
     retval(2) = mach_info::float_format_as_string (os.float_format ());
+    retval(3) = os.encoding ();
 
     return retval;
   }