The reason I ended up at this point is that I realized I would have to deal with the ENV_IS_CASELESS code in hv.c. So, this post is not part of the N-part trilogy of adding Unicode support to perl on the Windows command line. The mechanics of the changes are not that hard, but this made me realize something which I thought was interesting. This requires a small change in mg.c and a much more significant change in hv.c (I must admit, I had not realized until now most of Perl’s hash functionality existed in a single 600 line function).
The next step will be to ensure that the relevant parts of the code know about this.
The first step was to translate the UTF-16 environment which wmain received to a UTF-8 encoded one. I have been poking around perl’s internals in my quest to help perl see interesting characters in names and values of environment variables.