diff libinterp/corefcn/urlwrite.cc @ 28467:159b6a1eb408

Use wide character overload to open file streams on Windows. * liboctave/system/lo-sysdep.cc, liboctave/system/lo-sysdep.h (fstream, ifstream, ofstream): Add "wrapper" functions to open file streams. * libinterp/corefcn/__fcn__.cc (F__ftp_mput__, F__ftp_mget__), libinterp/corefcn/debug.cc (do_dbtype), libinterp/corefcn/help.cc (help_system::raw_help_from_docstrings_file), libinterp/corefcn/load-save.cc (check_gzip_magic, load_save_system::get_file_format, load_save_system::dump_octave_core, load_save_system::load, load_save_system::save), libinterp/corefcn/oct-hist.cc (mk_tmp_hist_file, history_system::do_edit_history), libinterp/corefcn/urlwrite.cc (Furlwrite), libinterp/octave-value/ov-java.cc (read_java_opts, read_classpath_txt), libinterp/parse-tree/oct-parse.yy (get_file_line), liboctave/util/cmd-hist.cc (gnu_history::do_append), liboctave/util/file-info.cc (file_info::snarf_file), liboctave/util/url-transfer.cc (base_url_transfer::mget_directory, base_url_transfer::mput_directory): Use new functions. * libinterp/corefcn/dlmread.cc (dlmread): Use wide character overload for std::ifstream::open on Windows. * src/mkoctfile.in.cc (octave_u8_conv_to_encoding): Dummy function for cross-compiler. (main): Use wide character overload of std::ofstream::open on Windows.
author Markus Mützel <markus.muetzel@gmx.de>
date Fri, 12 Jun 2020 22:13:04 +0200
parents 9f9ac219896d
children 28913793f678 0a5b15007766
line wrap: on
line diff
--- a/libinterp/corefcn/urlwrite.cc	Fri Jun 12 11:39:35 2020 -0400
+++ b/libinterp/corefcn/urlwrite.cc	Fri Jun 12 22:13:04 2020 +0200
@@ -142,7 +142,8 @@
 
   octave::sys::file_stat fs (filename);
 
-  std::ofstream ofile (filename.c_str (), std::ios::out | std::ios::binary);
+  std::ofstream ofile =
+    octave::sys::ofstream (filename.c_str (), std::ios::out | std::ios::binary);
 
   if (! ofile.is_open ())
     error ("urlwrite: unable to open file");