<HTML><HEAD>
<META content="text/html charset=iso-8859-1" http-equiv=Content-Type></HEAD>
<BODY
style="WORD-WRAP: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space"
dir=ltr>
<DIV dir=ltr>
<DIV style="FONT-FAMILY: 'Verdana'; COLOR: #000000; FONT-SIZE: 10pt">
<DIV>Ola Lucas, este é o exemplo classico que esta no cpan, devo estar fazendo
algo errado, pois não esta funcionando. mesmo assim vou tentar novamente com seu
código no lugar do meu.</DIV>
<DIV> </DIV>
<DIV>vale lembrar que.</DIV>
<DIV> </DIV>
<DIV>Estou imprimindo via web e tenho a certeza de estar colocando nos headres
da pagina <meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" /></DIV>
<DIV> </DIV>
<DIV>Recebo a string via LWP, por isto criei uma função em um arquivo ex:
lib_converte_uft8.pl onde no arquivo principal que esta imprimindo a string,
antes de imprimir faço a conversão.</DIV>
<DIV> </DIV>
<DIV>ou seja, esta é a sequincia</DIV>
<DIV> </DIV>
<DIV>$string=busca_via_LPW($string);</DIV>
<DIV>$string=converte($string);</DIV>
<DIV> </DIV>
<DIV>print $string;</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>mas continua imprimindo em utf8.</DIV>
<DIV> </DIV>
<DIV>Por exemplo a palavra são vem S\u00e3o e deveria ficar São</DIV>
<DIV> </DIV>
<DIV>Acho que o erro deva estar durante a passagem entre o recebimento via LWP.
Acho que vou tentar converter para ascii, neste caso os acentos não serão
iportantes, nem mesmo o ç. </DIV>
<DIV> </DIV>
<DIV>Mesmo assim vou continuar pesquisando... já ta rolando uma semana. </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>Mas Obrigado.</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV
style="FONT-STYLE: normal; DISPLAY: inline; FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: small; FONT-WEIGHT: normal; TEXT-DECORATION: none">
<DIV style="FONT: 10pt tahoma">
<DIV> </DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A
title=lucasmateus.oliveira@gmail.com
href="mailto:lucasmateus.oliveira@gmail.com">Lucas Oliveira</A> </DIV>
<DIV><B>Sent:</B> Thursday, October 03, 2013 9:34 AM</DIV>
<DIV><B>To:</B> <A title=saopaulo-pm@mail.pm.org
href="mailto:saopaulo-pm@mail.pm.org">saopaulo-pm@mail.pm.org</A> </DIV>
<DIV><B>Subject:</B> Re: [SP-pm] Moduo Encode</DIV></DIV></DIV>
<DIV> </DIV></DIV>
<DIV
style="FONT-STYLE: normal; DISPLAY: inline; FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: small; FONT-WEIGHT: normal; TEXT-DECORATION: none">
<DIV> </DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span></SPAN>Tente
isso.</DIV>
<DIV> </DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span></SPAN>sub utf8_to_iso
{</DIV>
<DIV> use
Encode;</DIV>
<DIV> my
($string) = @_;</DIV>
<DIV> eval
{</DIV>
<DIV>
$string = decode('utf8', $string, Encode::FB_CROAK);</DIV>
<DIV>
$string = encode('iso-8859-1', $string)</DIV>
<DIV> };</DIV>
<DIV> return
$string;</DIV>
<DIV> }</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>
<DIV>Em 03/10/2013, às 08:29, "Ricardo Stock" <<A
href="mailto:ricardostock@bol.com.br">ricardostock@bol.com.br</A>>
escreveu:</DIV><BR class=Apple-interchange-newline>
<BLOCKQUOTE type="cite">
<DIV dir=ltr>
<DIV dir=ltr>
<DIV style="FONT-FAMILY: verdana; FONT-SIZE: 10pt">
<DIV> Bom dia a todos.</DIV>
<DIV> </DIV>
<DIV> Pessoal estou tentando utilizar o modulo Encode
para a conversão de utf8 para iso, porem não estou conseguindo, segue
trecho do codigo.</DIV>
<DIV> </DIV>
<DIV>sub Converte {</DIV>
<DIV> use Encode;</DIV>
<DIV> my $string=undef;</DIV>
<DIV> ($string)=@_;</DIV>
<DIV> $string= decode_qp($string);</DIV>
<DIV> $string=encode('iso-8859-1', $string);</DIV>
<DIV> </DIV>
<DIV> return $string;</DIV>
<DIV>}</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>porem continua e imprimir em utf8.</DIV>
<DIV> </DIV>
<DIV>Qlguma dica.</DIV>
<DIV> </DIV>
<DIV>Obrigado</DIV>
<DIV> </DIV>
<DIV style="FONT-FAMILY: verdana; FONT-SIZE: 10pt">Ricardo Stock<BR><A
href="http://www.stocksistemas.com.br">http://www.stocksistemas.com.br</A></DIV></DIV></DIV></DIV>=begin
disclaimer<BR> Sao Paulo Perl Mongers: <A
href="http://sao-paulo.pm.org/">http://sao-paulo.pm.org/</A><BR>SaoPaulo-pm
mailing list: <A
href="mailto:SaoPaulo-pm@pm.org">SaoPaulo-pm@pm.org</A><BR>L<<A
href="http://mail.pm.org/mailman/listinfo/saopaulo-pm">http://mail.pm.org/mailman/listinfo/saopaulo-pm</A>><BR>=end
disclaimer<BR></BLOCKQUOTE></DIV><BR>
<P>
<HR>
=begin disclaimer<BR> Sao Paulo Perl Mongers:
http://sao-paulo.pm.org/<BR>SaoPaulo-pm mailing list:
SaoPaulo-pm@pm.org<BR>L<http://mail.pm.org/mailman/listinfo/saopaulo-pm><BR>=end
disclaimer<BR></DIV></DIV></DIV></BODY></HTML>