in reply to how to calculate the length for other language content in PERL?

That looks like HTML character codes. Your method just counts how many characters are in that string, which seems to be 268.

The fix is simple. Install HTML::Entities, and follow the examples given(like the one in the synopsis), and go from there.

HTH

~Thomas~ 
"Excuse me for butting in, but I'm interrupt-driven..."
  • Comment on Re: how to calculate the length for other language content in PERL?

Replies are listed 'Best First'.
Re^2: how to calculate the length for other language content in PERL?
by vasanthgk91 (Sexton) on May 15, 2013 at 07:13 UTC
    That is not a html entities..that is a tamil language content..when i paste in textarea It's look like that

      Yes, I know that. I meant your string with all the ampersands -- those are HTML Entities. They represent those characters, but in order to get the actual characters, you need to decode that first.
      This is where HTML::Entities comes in. Feed your string through decode_entities, and then do your thing with encode_guess, if needed still. The length of the output of decode_entities($title) is the string you should find the length of.

      ~Thomas~ 
      "Excuse me for butting in, but I'm interrupt-driven..."

        thank u very much....

        use HTML::Entities; $title=decode_entities($title); my $title_length=length($title); $title=encode_entities($title);

        It's working

      sorry vasanth!