http://qs321.pair.com?node_id=1039748


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 (Patriarch) 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";