Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EPrints, PERL 5.16 and utf8::decode() #88

sebastfr opened this issue Jun 13, 2013 · 1 comment

EPrints, PERL 5.16 and utf8::decode() #88

sebastfr opened this issue Jun 13, 2013 · 1 comment


Copy link

@sebastfr sebastfr commented Jun 13, 2013

See Ian Stuart's email on ep-tech about this and check how this will affect EPrints:

I don't know if this has surfaced as an issue yet, however Perl has
changed the behaviour of utf8::decode() as of 5.16

Prior to 5.16, if you decoded an undef value, you got undef back
From 5.16 onwards, decoding a value always returns a string, even if
its a null string (defined, but zero length: "")

This was a major problem in EPrints::Repository::param for me, as it is
used in EPrints::Plugin::Export::param:

sub param
my( $self, $paramid ) = @_;

# Allow args to override mimetype
if( $self->{session}->get_online
 && $paramid eq "mimetype"
 && defined $self->{session}->param( "mimetype" ) )

flawed as $self->{session}->param( "mimetype" ) always

returns defined

    return $self->{session}->param( "mimetype" );
return $self->SUPER::param( $paramid );


In 3.2.9, there are not that many files that use itf8::decode

From my review of them, the following already address the problem:

The following need to be reviewed, as they may now have unforseen

The following I'm not sure about, but I think are basically safe:

... this may have been addressed in 3.3.

Copy link
Contributor Author

@sebastfr sebastfr commented May 30, 2014

Commit #88

Fixed the issues.

I reviewed the other instances of "utf8::decode" in the code but nothing to worry about since a string is expected in the context.

Other references mentioned by Ian on 3.2.9 do not exist in 3.3 (eg. Update/

@sebastfr sebastfr closed this May 30, 2014
@sebastfr sebastfr added the bug label May 30, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.