From: Bastian M. <bma...@we...> - 2020-11-03 15:57:31
|
> Gesendet: Montag, 02. November 2020 um 21:37 Uhr > Von: "Allin Cottrell" <cot...@wf...> > An: "Ethan A Merritt" <me...@uw...> > Cc: "Bastian Märkisch" <bma...@we...>, "gnuplot-beta" <gnu...@li...> > Betreff: Re: AW: filenames on MS Windows > > On Mon, 2 Nov 2020, Ethan A Merritt wrote: > > > On Monday, 2 November 2020 01:48:42 PST Bastian Märkisch wrote: > >> Right now, gnuplot is able to "load" file names with Unicode encoded names, i.e. the sequence > >> set encoding utf8 > >> load 'абвгдежзийклмнопрстуфхцчшщъыьэюяѐёђѓєѕіїјљњћќѝўџ.plt' > >> will work just fine. > > > > But only if the encoding is set to utf8, right? > > Which is a bit counter-intuitive since on Windows the > > filename is not actually utf8. > > Counter-intuitive maybe, but it's very convenient. "set encoding > utf8" announces that filenames in the gnuplot script will be UTF-8 > encoded (and the script will be readable cross-platform), but thanks > to Bastian gnuplot knows they need to be recoded in the background > to UTF-16 for reading from disk on Windows. Windows mostly uses UTF16 to support Unicode. gnuplot uses char-based (byte) encodings only and - as many other programs from the *nix world - uses UTF-8 for Unicode. Internally, gnuplot will use whatever encoding it is told to use by the user via "set encoding". The translation from and to UTF16 for input, output, file names, pipes, clipboard interaction etc. is transparent to the user. This translation is not done for command line arguments yet as pointed out by Allin. The scheme itself is common practise to "port" applications and was introduced in 2016. (Note that as of now, file _content_ cannot be read or written in UTF16 encoding.) Bastian |