From: Allin C. <cot...@wf...> - 2020-11-03 15:42:24
|
On Mon, 2 Nov 2020, Allin Cottrell wrote: > On Mon, 2 Nov 2020, Bastian Märkisch wrote: [...] > >> That really poses the question if we should change the default >> internal encoding from "ANSI" (whatever that may be depends on >> the Windows locale) to UTF-8. I agree with that (and in fact my >> personal gnuplot.ini includes "set encoding utf8" since a long >> time). >> >> But how do we make this backward compatible since that will >> inevitably break load commands in old "ANSI" encoded user >> scripts? (as does your current patch btw) > > Are you sure about that breakage, Bastian? [...] I'm not sure I've understood the circumstances under which you reckon my patch would break load commands, but I just tried an experiment which I think is relevant. This is on Windows 10 with system codepage 1252, using my patched wgnuplot.exe. I placed a gnuplot script in a directory named with Cyrillic characters (so not representable in CP1252), reading as follows: # loader script set encoding cp1252 load '<CP1252 filename>' where <CP1252 filename> is the full path to a second script, in a directory with a non-ASCII name representable in CP1252. (It contains an o-circumflex.) The second script reads thus: # plot script set term pngcairo set output '<CP1252 output>' plot sin(x) where <CP1252 output> is again a full path including the non-ASCII but CP-friendly directory name. I then called wgnuplot.exe on the "loader" script, passing its filename as UTF-16, and it all went fine: the loader was read OK, from its Cyrillic location; the load command worked; and the PNG was written successfully. -- Allin Cottrell Department of Economics Wake Forest University |