in reply to Re: Carp::Heavy panic: malloc Unicode?
in thread Carp::Heavy panic: malloc Unicode?
Anyway, I can't say that I approve of the approach taken in that patch. All it's doing is: if the string has the utf8 flag on, avoid trying to make any non-visible or non-ascii characters "displayable" by converting them to hex notation.
Rather than just give up completely on utf8 strings, wouldn't it be better to use a different approach? e.g.:
I'm not sure, but I think that should avoid the malloc explosion caused by using [[:cntrl:]]|[[:^ascii:]] on a utf8 string.$arg = join "", map { ($_ lt ' ' or $_ gt '~') ? sprintf("\\x{%x}",ord) : $_ } split //, $arg;
|
---|