The (text-)string commands in Perl operate on a character and not byte basis. A string carries an internal utf8 flag which determines how it's handled.
Saying so, some commands like unpack or vec are supposed to operate on raw bit vectors and might be useful here.
*) i.e. variable byte length character
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
FootballPerl is like chess, only without the dice
In reply to Re^2: truncate string to byte count
by LanX
in thread truncate string to byte count
by morgon
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |