Re: replace chars
- From: rvtol+news@xxxxxxxxxxxx (Dr.Ruud)
- Date: Thu, 27 Dec 2007 00:16:34 +0100
"Octavian Rasnita" schreef:
I have also seen that length($string) returns the number of bytes of
$string, and not the number of chars (if the string contains UTF-8
chars).
This tells me that you are taking input from an octet buffer that comes
from outside.
my $octets = <>;
my $string;
eval {
$string = Encode::decode("utf8", $octets, Encode::FB_CROAK);
1;
} or {
# malformed input
}
--
Affijn, Ruud
"Gewoon is een tijger."
.
- Follow-Ups:
- Re: replace chars
- From: Octavian Rasnita
- Re: replace chars
- References:
- replace chars
- From: Octavian Rasnita
- Re: replace chars
- From: Tom Phoenix
- Re: replace chars
- From: Gunnar Hjalmarsson
- Re: replace chars
- From: Octavian Rasnita
- Re: replace chars
- From: Gunnar Hjalmarsson
- Re: replace chars
- From: Chas. Owens
- Re: replace chars
- From: Octavian Rasnita
- replace chars
- Prev by Date: WinXP command prompt window scrolls very slow
- Next by Date: RE: WinXP command prompt window scrolls very slow
- Previous by thread: Re: replace chars
- Next by thread: Re: replace chars
- Index(es):
Relevant Pages
|
|