New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Environment variables are case insensitive on Windows #6071
Comments
From @nanis$ echo %windir% $ echo %WINDIR% $ c:\opt\perl6-mingw\bin\perl6 -e "say %*ENV<WINDIR>" $ c:\opt\perl6-mingw\bin\perl6 -e "say %*ENV<windir>" $ c:\opt\perl6-mingw\bin\perl6 -v Both %*ENV<WINDIR> and %*ENV<windir> (as well as, e.g., %*ENV<WinDir> -- Sinan |
From @zoffixznetOn Mon, 13 Feb 2017 14:38:03 -0800, nanis@cpan.org wrote:
What would be a good approach? Store them in whatever case they come in, but apply fc() when looking up keys? If I dump all the vars with `set` I see all-uppercase, mixed-case, and all-lowercase vars. Perl 5 seems to uppercase them all (when I dump %ENV with Data::Dumper). And that naturally leads to what to do with stuff like 'ß', which Perl 5 dumps out to me as `'▀' => '42',` I'm thinking of just sticking a subclass of Hash to %*ENV on Windows, something along the lines of $ perl6 -e 'my %h := class :: is Hash { method AT-KEY ($k) { nextwith $k.fc }; method ASSIGN-KEY ($k, $v) { nextwith $k.fc, $v } }.new; %h<Foo> = 42; dd %h; dd %h<foo>' {:foo(42)} |
The RT System itself - Status changed from 'new' to 'open' |
From @nanisI am not sure what the right strategy is ... Perl 5 seems to work I opened this issue because I am going to think about it and thought The simple solution seems to work, but I do believe case needs to be preserved. Anyway, this is a low priority issue and I am not even certain any -- Sinan |
From @nanisI have done some research on this issue. The "correct" behavior seems Michael Kaplan's guidance[1] on file names seems to also describe how
To test whether the same applied to names of environment variables as The most straightforward function to use is thus CharUpperBuffW[2]. [1]: http://archives.miloush.net/michkap/archive/2005/10/17/481600.html |
Migrated from rt.perl.org#130776 (status was 'open')
Searchable as RT130776$
The text was updated successfully, but these errors were encountered: