Comments (2)
[email protected] - 2010-05-16 21:26:09
In one of my scripts, before I load CGI.pm, I have an encoding() layer
set on STDOUT. Simply calling "use CGI;" will remove that layer, because
CGI.pm does this:if ($needs_binmode) {
$CGI::DefaultClass->binmode(*main::STDOUT);
$CGI::DefaultClass->binmode(*main::STDIN);
$CGI::DefaultClass->binmode(*main::STDERR);
}Thus clearing any already-pushed IO layer.
Thanks for the report. What alternative do you recommend?
Mark
from cgi.pm.
MKANAT - 2010-05-16 22:50:38
On Sun May 16 17:26:09 2010, [email protected] wrote:
Thanks for the report. What alternative do you recommend?
I'm actually not quite sure. I don't know how to check if a file handle
is already in binmode. I do know how to check if it has an encoding or
utf8 layer on it, though, which is PerlIO::get_layers(FH).
What's the purpose of setting binmode on STD* on Windows? Is it so that
it doesn't do CR->CRLF conversion? I don't know if any way to
specifically remove the :crlf layer, but if there was one, that might be
a better solution.
A simple solution that would resolve my problem would be to not call
CORE::binmode on any of the file handles if they have any non-default
layers (that is, layers other than :crlf, :unix, and :perlio).
from cgi.pm.
Related Issues (20)
- Don't require quotes for multipart/form-data HOT 4
- start_form isn't mentioned in the man page HOT 2
- SameSite=None not mentioned in Pod? HOT 1
- Probable typo HOT 1
- CGI::Cookie->bake() doesn't work with mod_perl redirects HOT 1
- $q->url(-rewrite=>0) doesn't return rewritten URI HOT 2
- Nondeterministic hash key ordering HOT 1
- CGI:cookie subroutine does not pass max-age to CGI::Cookie->new
- Copying max-age from a cookie HOT 2
- Getting error Odd number of elements in hash assignment at .../CGI/Util.pm line 112 in apache log file HOT 11
- Remove dependency on CGI.pm in high river CPAN dists. HOT 4
- Buggy cache in CGI->cookie HOT 1
- How to get header info when using hook HOT 7
- _decode_utf8() method allows invalid UTF-8 sequences. HOT 3
- IPv6 addresses not handled correctly HOT 2
- t/changes.t fails if Test::CPAN::Changes HOT 1
- 4.59: test suite is failing HOT 1
- ->url being a object breaks everything HOT 4
- tar: Ignoring malformed pax extended attribute HOT 3
- Homepage 404 not found HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cgi.pm.