in reply to How to count string length with latin characters?
I'm confused. There are 40 characters in that string!
Note too that the characters you have posted render as utf-8 characters (at least for me).
The following may help however:
use strict; use warnings; use Encode; my $str = "הההההההההההההההההההההההההההההההההההההההה"; print 'Raw: ' . length $str; print "\nDecoded: " . length decode ('utf8', $str);
Prints:
Raw: 80 Decoded: 40
If the encoding you are using really is latin1 then using decode ('iso-8859-1', $str) may turn the trick for you.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to count string length with latin characters?
by newblet (Novice) on Nov 02, 2006 at 00:17 UTC |