[prev in list] [next in list] [prev in thread] [next in thread] 

List:       perl-xml
Subject:    Re: How to print the right caracters?
From:       Javier =?ISO-8859-1?Q?D=EDaz?= <javierdiazm () yahoo ! com ! mx>
Date:       2004-05-13 13:32:45
Message-ID: 1084455165.3256.17.camel () radeon
[Download RAW message or body]

Dude, you are absolutely right :)
toStringHTML fixed my problem 

I'll still try XML output in latin-1, it will be useful for non-html
output.

Thanks a lot
> Try print $doc->toStringHTML;
>                         ^^^^
> 
> You'll get
> 
> <html>a b c d e f g h i j k l m n o p
> q r s t u v w x y z &aacute; &eacute; &iacute; &oacute; &uacute; &ntilde;</html>
> 
> which looks good to me.
> 
> Or, if you insist on XML output in latin-1, you can
> $doc->setEncoding('iso-8859-1'), leaving the rest of your code as it
> $doc->is.
> 
> If your browser can't handle xml encoding declaration (<?xml
> ... encoding=...?>), it should at least obey html meta tag:
> 
> <body>
>   <head>
>     <meta http-equiv="Content-Type" content="text/html;
>       charset=iso-8859-1">
>  </head>
> </body>
> 
> >
> > the output looks like this:
> >
> > <?xml version="1.0"?>
> > <html>a b c d e f g h i j k l m n o p q r s t u v w x y z &#xC3;&#xA1;
> > &#xC3;&#xA9; &#xC3;&#xAD; &#xC3;&#xB1; &#xC3;&#xB3; &#xC3;&#xBA;
> > &#xC3;&#xB1;</html>
> >
> > so the browser, renders it like this:
> >
> > a b c d e f g h i j k l m n o p q r s t u v w x y z á é í ñ ó ú Ã
> 
> (browser's fault - it should recoginze xml which implies UTF-8).
> 
> -- Petr
-- 
Javier Díaz <javierdiazm@yahoo.com.mx>

_______________________________________________
Perl-XML mailing list
Perl-XML@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic