| Store | Cart

AW: How to create an xml file with XMLWriter that has 0A newlines in strings

From: Nagy Tamas (TVI-GmbH) <tama...@tvi-gmbh.de>
Mon, 8 Jun 2015 08:58:27 +0000
Hi,

"perl -p -i -e 'BEGIN {print %x "EFBBBF" }' default.xml
Can't find string terminator "'" anywhere before EOF at -e line 1."
Can't find string terminator "'" anywhere before EOF at -e line 1.

How to do it with this PERL line?

%x prints hexa, but it does not work. 

On Wed, Jun 03, 2015 at 08:16:52AM +0000, Nagy Tamas (TVI-GmbH) wrote:

> Hi,> > Ok, but how to write the „EF BB BF“ BOM code to  the beginning?> With XML::Writer the print OUTPUT chr(65279) does not do anything.> > my $output;> my $writer;> > $output = IO::File->new(">default.xml");> > $writer = XML::Writer->new(OUTPUT => $output, DATA_MODE => 1, DATA_INDENT => "  ", ENCODING => "utf-8", NEWLINES => 0 );> > binmode(OUTPUT, ":utf8");> print OUTPUT chr(65279); #BOM

Shouldn't that be

    binmode($output, ":utf8");
    print $output chr(65279);

?

I'd probably use File::BOM however

Karl
_______________________________________________
Perl-XML mailing list
Perl...@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
Perl-XML mailing list
Perl...@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Recent Messages in this Thread
Nagy Tamas (TVI-GmbH) Jun 02, 2015 02:14 pm
Tod Harter Jun 02, 2015 06:01 pm
Nagy Tamas (TVI-GmbH) Jun 03, 2015 08:16 am
Tod Harter Jun 03, 2015 02:25 pm
Karl Billeter Jun 05, 2015 05:35 am
Nagy Tamas (TVI-GmbH) Jun 08, 2015 08:58 am
David Thomas Jun 08, 2015 02:53 pm
Shlomi Fish Jun 02, 2015 06:14 pm
Messages in this thread