http://qs321.pair.com?node_id=1174461

gregor42 has asked for the wisdom of the Perl Monks concerning the following question:

I am humbled and seeking help.

This concerns data containing names so getting it Right is important.

It is likely that I am fundamentally missing something when it comes to safely concatenating strings.

A hand-rolled point solution sometimes works as intended and others times results in the dreaded:

Wide character in syswrite
error.

I assume that the problem is my code and not the data coming in since one can usually depend on people to get their own names right.. But then i18n characters are tricksy, like Hobbits...

sub jibe { my($s,$t) = @_; my $r = join('', (is_utf8($s)?$s:decode('utf8',$s)), (is_utf8($t)?$t +:decode('utf8',$t))); return $r; }

To give it context, let's say that we are creating common name from given name plus surname: (Anglo-centric, I know...)

my $cn = jibe(jibe($givenname," "),$sn);

Thank you in advance for any nudges in the right direction that anyone might provide.



Wait! This isn't a Parachute, this is a Backpack!