[interchange-bugs] [rt.icdevgroup.org #339] [import] mangles UTF-8 characters

David Christensen via RT interchange at rt.icdevgroup.org
Sun Apr 18 01:12:12 UTC 2010


<URL: http://rt.icdevgroup.org/Ticket/Display.html?id=339 >

> sub new_filehandle {
> 	my $fh = shift;
> 	binmode($fh, ":utf8") if $::Variable->{MV_UTF8};
> 	return $fh;
> }

Testing has revealed that in this case at least, $::Variable->{MV_UTF8} is unset, while $Global::Variable->{MV_UTF8} is set.

It's my understanding that $Global::Variable always contains all Variables set in interchange.cfg, while $::Variable either aliases $Global::Variable if outside a particular catalog context or aliases the specific set of variables defined in the particular catalog.cfg.  For this to work as intended, we should check both $Global::Variable and $::Variable to catch either context (i.e., defined at the global or catalog level).

This makes me wonder how effective some of the other MV_UTF8 conditionals have been; I suspect it will be largely conditional on the context in which the code runs.  Since [import] is run as a catalog-level usertag, this would be why it's reverting to the catalog's variable namespace, while most of the other places MV_UTF8 is checked would be running in global space.  In any case, I think we should review other usages and possibly fix to the double-comparison $::Variable->{MV_UTF8} || $Global::Variable->{MV_UTF8}.

Regards,

David




More information about the interchange-bugs mailing list