Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re^2: HTML::Entities not working

by vasanthgk91 (Sexton)
on Jun 19, 2013 at 09:14 UTC ( #1039748=note: print w/replies, xml ) Need Help??

in reply to Re: HTML::Entities not working
in thread HTML::Entities not working

This is my input: 社論並指,香港及中國輿論反對引渡史諾登,美國實際上已有思想準備「無法引渡」史諾登,中方應創造條件讓美方最終放棄引渡的希望,避免美方將希望寄託在對香港和北京施加愈來愈大的壓力上。 Read more: 世界新聞網-北美華文新聞、華商資訊 - 中國官媒 引渡史諾登 中港都丟臉

This input i need exact perl length..that decode_entities not working

Replies are listed 'Best First'.
Re^3: HTML::Entities not working
by Corion (Pope) on Jun 19, 2013 at 09:29 UTC

    The problem seems not to be with HTML::Entities:

    > perl -MHTML::Entities=decode_entities -e "print length decode_entiti +es('社論')" 2

    As you've been told before, you will need to find out what encoding the browser uses to send your input data to your script. This is not necessarily easy to enforce. One good approach is to use <meta http-equiv="Content-Type" ... tags on every HTML page, no matter where it is served from.

      Thank u ..I Got the output...

Re^3: HTML::Entities not working
by muba (Priest) on Jun 19, 2013 at 15:27 UTC

    I see no entities that would need decoding. What exact output did you expect? What exact output did you get?

    Without knowing what you want, it is hard to know how to get there.

      Thank u ..I Got the output...

      use HTML::Entities; use Encode; my $first_name_assign="$firstname"; $first_name_assign=decode('UTF-8',$first_name_assign); $first_name_assign=decode_entities($first_name_assign); my $first_name_length=length($first_name_assign); print "$first_name_length";

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1039748]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2021-04-17 21:53 GMT
Find Nodes?
    Voting Booth?

    No recent polls found