Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: utf8 is_valid on concat

by threedaygoaty (Novice)
on Mar 14, 2008 at 03:53 UTC ( [id://674140]=note: print w/replies, xml ) Need Help??


in reply to Re: utf8 is_valid on concat
in thread utf8 is_valid on concat

Thanks for this, AFAIK we are using utf8 functions correctly. However, it is very likely that somewhere in 200K lines of perl a simple string concat is happening between a UTF8 string and a non-UTF8 string. My idea is to try to trap this so we can find it. The only way I can think of doing is to overload the concat operator. I'm also keen to know if it is possible. We tried this but it does not work...
use strict; package UNIVERSAL; use overload "." => \&concat; sub concat { my ($a, $b) = @_; return join "XXX", $a, $b; } package Foo; my $thing = "cat" . "dog"; print "\n\n\n$thing\n\n\n";
This produces catdog

Replies are listed 'Best First'.
Re^3: utf8 is_valid on concat
by Juerd (Abbot) on Mar 16, 2008 at 01:29 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://674140]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (3)
As of 2026-05-10 11:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.