Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

XML::Writer "wrong" utf8 output

by budik_je_vypnuty (Initiate)
on Mar 08, 2013 at 10:07 UTC ( [id://1022373]=perlquestion: print w/replies, xml ) Need Help??

budik_je_vypnuty has asked for the wisdom of the Perl Monks concerning the following question:

Dear holy monks !

I'm using XML::Writer with these setting

use utf8; my $wr_xml = new XML::Writer(OUTPUT => $output,UNSAFE => 1,ENCODING => + 'utf-8');

Everything works fine, except

\t

tabulator. The output seems like this

type="const char 		* const"

Using Perl v5.8.8

Thank you

Replies are listed 'Best First'.
Re: XML::Writer "wrong" utf8 output
by tobyink (Canon) on Mar 08, 2013 at 10:11 UTC

    It's XML. Per spec, the hard tab character and 	 (and indeed 	) are defined to mean exactly the same thing.

    If the output is going to be fed to an XML tool, that XML tool shouldn't care whether you've used a hard tab or whether you've used 	.

    If the output is going to be fed to a non-XML tool, then why the hell are you feeding XML to a non-XML tool?! Stop doing that.

    package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name
      Actually, no they're not. A literal tab is considered whitespace in attribute values, whereas 	 refers to a tab. So if you want to include a tab in the attribute, you *have* to use 	.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1022373]
Approved by tobyink
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-03-29 05:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found