Git Product home page Git Product logo

encode-locale's People

Contributors

dsteinbrunner avatar gfx avatar gisle avatar matsp888 avatar mohawk2 avatar periapt avatar szabgab avatar tsibley avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

encode-locale's Issues

Cygwin - t/env.t not running last 3 tests

When using Cygwin the t/env.t test fails because only the first 10 tests run. The final 3 tests do not run at all. Changing the number of tests from 13 to 10 causes the results of make test or prove -b t/*.t to succeed.

I don't see any reason why perl would skip the last three tests. CPAN Testers, here, shows this module often has trouble in Cygwin. Any ideas as to why this happens or how I can help resolve the issue?

Use Win32::GetACP() when available

Win32::GetACP() is available in Win32.pm version 0.45 or later, which has been bundled in Perl 5.18 and later. Given that it is a core module, I think it should always be tried first before loading Win32::API.

Should 65001 be recognized as a valid codepage in Windows console?

Update: Thinking more about this, I think it is more an Encode::Alias issue. Am I correct?

C:\...> set PERL_ENCODE_DEBUG=1                                                                            
                                                                                                                                 
C:\...> cpan-outdated | cpanm                                                                              
delete $Alias{C} at c:/opt/perl-5.20.2/site/lib/Encode/Alias.pm line 100.                                                        
delete $Alias{ascii} at c:/opt/perl-5.20.2/site/lib/Encode/Alias.pm line 100.                                                    
delete $Alias{cyrillic} at c:/opt/perl-5.20.2/site/lib/Encode/Alias.pm line 100.                                                 
delete $Alias{arabic} at c:/opt/perl-5.20.2/site/lib/Encode/Alias.pm line 100.                                                   
delete $Alias{greek} at c:/opt/perl-5.20.2/site/lib/Encode/Alias.pm line 100.                                                    
delete $Alias{hebrew} at c:/opt/perl-5.20.2/site/lib/Encode/Alias.pm line 100.                                                   
delete $Alias{thai} at c:/opt/perl-5.20.2/site/lib/Encode/Alias.pm line 100.                                                     
Encode::utf8 XS on at c:/opt/perl-5.20.2/site/lib/Encode.pm line 323.                                                            
eval "\L$1" at c:/opt/perl-5.20.2/site/lib/Encode/Alias.pm line 32.                                                              
find_alias(Encode, cp65001)->name =  at c:/opt/perl-5.20.2/site/lib/Encode/Alias.pm line 75.                                     
The locale codeset (cp65001) isn't one that perl can decode, stopped at c:/opt/perl-5.20.2/site/lib/Encode/Locale.pm line 123.   
Compilation failed in require at c:/opt/perl-5.20.2/site/lib/LWP/UserAgent.pm line 1001.                                         
Compilation failed in require at c:\opt\perl-5.20.2\bin/cpan-outdated line 11.                                                   
BEGIN failed--compilation aborted at c:\opt\perl-5.20.2\bin/cpan-outdated line 11.

Codepage 65001 is the the UTF-8 codepage on Windows, see Code Page Identifiers.

But, I get the following:

C:\...> cpan-outdated | cpanm
The locale codeset (cp65001) isn't one that perl can decode, stopped at c:/opt/perl-5.20.2/site/lib/Encode/Locale.pm line 123.
Compilation failed in require at c:/opt/perl-5.20.2/site/lib/LWP/UserAgent.pm line 1001.
Compilation failed in require at c:\opt\perl-5.20.2\bin/cpan-outdated line 11.
BEGIN failed--compilation aborted at c:\opt\perl-5.20.2\bin/cpan-outdated line 11.

Use of "chcp" not permitted under CGI for non-admin users

I started a fairly detailed thread on StackOverflow for this problem: http://stackoverflow.com/questions/19772340/lwpuseragents-env-proxy-gives-access-is-denied-for-non-admin-users

Basically, Encode::Locale is used by LWP::UserAgent which is used by LWP::Simple, which I'm trying to use in a CGI script running under IIS with integrated Windows Authentication. That means that the CGI runs as the user logged into IIS, most of whom are NOT admins on the webserver.

Encode::Locale's fallback to calling "chcp" (actually, like this: "qx(chcp)") results in an "Access is denied" error. This is bad enough for Encode::Locale(), but if the CGI includes "use LWP::Simple;" (which is how my script was written), then the error happens at the beginning of the runtime (?), before any of the CGI can be setup, and the webpage user gets an error "The specified CGI application misbehaved by not returning a complete set of HTTP headers".

We need some workaround to NOT use "chcp" in environments like this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.