comparison libinterp/corefcn/pr-output.cc @ 31961:c1fc1e821381 stable

Don't use encoding facet when writing bytes to stream (bug #63931). * libinterp/corefcn/oct-stream.h (octave::stream::output_stream): Do not return output stream with encoding facet. (octave::stream::preferred_output_stream): Add new function that returns output stream with encoding facet if applicable. * libinterp/corefcn/pr-output.cc (Ffdisp): Use new function `preferred_output_stream` instead of `output_stream`.
author Markus Mützel <markus.muetzel@gmx.de>
date Sat, 01 Apr 2023 18:34:27 +0200
parents dd23a26b7294
children 476c84c4f201 1f7958de177f
comparison
equal deleted inserted replaced
31957:ce64ec8fe929 31961:c1fc1e821381
3395 3395
3396 int fid = streams.get_file_number (args(0)); 3396 int fid = streams.get_file_number (args(0));
3397 3397
3398 stream os = streams.lookup (fid, "fdisp"); 3398 stream os = streams.lookup (fid, "fdisp");
3399 3399
3400 std::ostream *osp = os.output_stream (); 3400 std::ostream *osp = os.preferred_output_stream ();
3401 3401
3402 if (! osp) 3402 if (! osp)
3403 error ("fdisp: stream FID not open for writing"); 3403 error ("fdisp: stream FID not open for writing");
3404 3404
3405 octave_value arg = args(1); 3405 octave_value arg = args(1);