Permalink
Browse files

Moved the bad utf8 handling of gettext_pp before sprintf (Mithaldu++)

  • Loading branch information...
1 parent 2984305 commit b4a28393576cc066823cec2ccf6b3f7386972fc5 @Getty committed Jan 22, 2013
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/Locale/Simple.pm
View
@@ -101,10 +101,11 @@ sub ldnp {
}
$return = sprintf($idp && $n != 1 ? $idp : $id, @args);
} else {
- $return = sprintf(dnpgettext($td, $ctxt, $id, $idp, $n),@args);
+ my $gt = dnpgettext($td, $ctxt, $id, $idp, $n);
+ # Fixing bad utf8 handling
+ utf8::decode($gt);
+ $return = sprintf($gt,@args);
}
- # Fixing bad utf8 handling
- utf8::decode($return);
return $return;
}

0 comments on commit b4a2839

Please sign in to comment.