Re: Assigning another filehandle to STDOUT, using binmode.
- From: Adam Funk <a24061@xxxxxxxxxxxxx>
- Date: Mon, 25 Jun 2007 20:25:11 +0100
On 2007-06-25, Peter J. Holzer wrote:
On 2007-06-25 10:28, Adam Funk <a24061@xxxxxxxxxxxxx> wrote:
As far as I can tell, I'm not getting errors or warnings reading the
input files (but I'm not doing it directly with my own code --- I'm
using XML::Twig's parsefile($input_filename) method; the input files
are XML with Cyrillic UTF-8 PCDATA) --- does Perl by default take the
environment into consideration,
No. By default it assumes (on Unix) binary input. You are reading and
writing a stream of bytes, not a stream of characters.
or assume UTF-8, for input but not output?
No. The XML parser gets the encoding from the XML file. If the XML file
doesn't explicitely specify an encoding, it must be UTF-8. This is
completely independent of the locale. XML files are supposed to be
portable and must not be interpreted differently depending on the
locale.
Oh of course! I got so caught in up in this business of setting
encodings that I forgot about the encoding specified explicitly in the
XML file.
.
- References:
- Assigning another filehandle to STDOUT, using binmode.
- From: Adam Funk
- Re: Assigning another filehandle to STDOUT, using binmode.
- From: Joe Smith
- Re: Assigning another filehandle to STDOUT, using binmode.
- From: Adam Funk
- Re: Assigning another filehandle to STDOUT, using binmode.
- From: Dr.Ruud
- Re: Assigning another filehandle to STDOUT, using binmode.
- From: Adam Funk
- Re: Assigning another filehandle to STDOUT, using binmode.
- From: Peter J. Holzer
- Re: Assigning another filehandle to STDOUT, using binmode.
- From: Adam Funk
- Re: Assigning another filehandle to STDOUT, using binmode.
- From: Peter J. Holzer
- Assigning another filehandle to STDOUT, using binmode.
- Prev by Date: Re: gcc help
- Next by Date: Re: Assigning another filehandle to STDOUT, using binmode.
- Previous by thread: Re: Assigning another filehandle to STDOUT, using binmode.
- Next by thread: Re: Assigning another filehandle to STDOUT, using binmode.
- Index(es):
Relevant Pages
|
Loading