changeset 28506:6bd9d77c7105 stable

Document that startup files are interpreted in the locale charset (bug #57235). * doc/interpreter/basics.txi (Startup Files): Document that startup files are interpreted in the locale charset initially.
author Markus Mützel <markus.muetzel@gmx.de>
date Sat, 27 Jun 2020 11:59:42 +0200
parents d747d57989e2
children d2a9728aed58 f4604e382ab0
files doc/interpreter/basics.txi
diffstat 1 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/doc/interpreter/basics.txi	Fri Jun 26 13:57:04 2020 -0700
+++ b/doc/interpreter/basics.txi	Sat Jun 27 11:59:42 2020 +0200
@@ -392,6 +392,22 @@
 invoke Octave with the @option{--verbose} option but without the
 @option{--silent} option.
 
+The startup files are always processes in the system's locale charset
+(independent of the .m file encoding that is set e.g. in the GUI properties).
+That is until a user manually sets the .m file encoding (e.g. in one of the
+startup files) and triggers re-parsing the .m files.  This can be done with the
+undocumented core function @code{__mfile_encoding__}:
+
+@example
+@group
+__mfile_encoding__ ("utf-8");  # set new encoding
+clear ("functions");  # re-parse all .m files in the new encoding
+@end group
+@end example
+
+This changes the encoding that is used to interpret all subsequently run startup
+and .m files (not including the currently executing file).
+
 @node Quitting Octave
 @section Quitting Octave
 @cindex exiting octave