diff --git a/lib/Vend/Table/Common.pm b/lib/Vend/Table/Common.pm index ee49e6a..b5375e8 100644 --- a/lib/Vend/Table/Common.pm +++ b/lib/Vend/Table/Common.pm @@ -58,6 +58,12 @@ use vars qw($FILENAME $EACH, ) = (0 .. 7); +unless( $ENV{MINIVEND_DISABLE_UTF8} ) { + require Encode; + import Encode qw( encode_utf8 ); + } + + # See if we can do Storable BEGIN { eval { @@ -165,7 +171,8 @@ sub unlock_table { sub stuff { my ($val) = @_; $val =~ s,([\t\%]),$Hex_string[ord($1)],eg; - return $val; + my $retval = encode_utf8($val) if $::Variable->{MV_UTF8}; + return $retval; } sub unstuff {