Re: Aw: filenames on MS Windows: follow-up

Allin Cottrell <[email protected]>
Newsgroups gmane.comp.graphics.gnuplot.devel
Message-ID <[email protected]>
On Thu, 3 Dec 2020, Bastian Märkisch wrote:

> Dear Allin,
>
> sorry for being slow to work on this. There is a fundamental issue with
> the approach, which I am working on how to resolve best. Translating all
> the command line arguments to UTF-8 is a great step forward and the
> loading of files works fine as you point out. But this change also
> affects and potentially breaks the -e option (try e.g.
> -d -e "print 'öäü'").

OK, I take your point: any non-ASCII stuff in a "-e" clause on the 
command line is going to get mangled.

> The best step in my opinion might be to just change gnuplot's default
> encoding to utf8. This will break backward compatibility, though. A
> remedy could be new command line options -a/-u which choose the system's
> default encoding ("ANSI") or the utf8 encoding.

I have one other thought, and I'll try experimenting. Besides 
setting argv to the UTF-8 recoded argument array in winmain.c, we 
could define (say) aargv to the "ANSI" version:

#define aargv __argv

then when iterating over the args in the test for interactivity 
(around line 630 in winmain.c) add a clause such as:

if ((argv[i][0] == '-') && (argv[i][1] == 'e')) {
     if (i < argc - 1) {
         argv[i+1] = aargv[i+1];
     }
}

This would (I think) replace the UTF-8 follow-up to -e with the 
original locale version, for passing to gnumain().

> Please find attached a simplified version of your patch, which also
> works for console mode gnuplot and other compilers than MinGW.

Thanks.

Allin Cottrell

_______________________________________________
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.