Aw: Re: AW: filenames on MS Windows

Bastian Märkisch <[email protected]>
Newsgroups gmane.comp.graphics.gnuplot.devel
Message-ID <trinity-c673cef0-e517-4ae2-b0a1-837881c519a4-1604419023763@3c-app-webde-bs33>
> Gesendet: Montag, 02. November 2020 um 21:37 Uhr
> Von: "Allin Cottrell" <[email protected]>
> An: "Ethan A Merritt" <[email protected]>
> Cc: "Bastian Märkisch" <[email protected]>, "gnuplot-beta" <[email protected]>
> 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





_______________________________________________
gnuplot-beta mailing list
[email protected]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-beta
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.