diff libinterp/corefcn/help.cc @ 29006:139df373c107 stable

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 68e6e6f083f3
children 040aa7a82662 0a5b15007766
line wrap: on
line diff
--- a/libinterp/corefcn/help.cc	Thu Oct 29 13:45:37 2020 +0100
+++ b/libinterp/corefcn/help.cc	Fri Jun 12 22:13:04 2020 +0200
@@ -600,11 +600,8 @@
 
     if (! initialized)
       {
-        std::string ascii_fname
-          = sys::get_ASCII_filename (m_built_in_docstrings_file);
-
-        std::ifstream file (ascii_fname.c_str (),
-                            std::ios::in | std::ios::binary);
+        std::ifstream file = sys::ifstream (m_built_in_docstrings_file.c_str (),
+                                            std::ios::in | std::ios::binary);
 
         if (! file)
           error ("failed to open docstrings file: %s",
@@ -686,11 +683,8 @@
         std::streampos beg = txt_limits.first;
         std::streamoff len = txt_limits.second;
 
-        std::string ascii_fname
-          = sys::get_ASCII_filename (m_built_in_docstrings_file);
-
-        std::ifstream file (ascii_fname.c_str (),
-                            std::ios::in | std::ios::binary);
+        std::ifstream file = sys::ifstream (m_built_in_docstrings_file.c_str (),
+                                            std::ios::in | std::ios::binary);
 
         if (! file)
           error ("failed to open docstrings file: %s",