From 61aff0e0775034b97c03d757f9011c5c29ff8f16 Mon Sep 17 00:00:00 2001 From: hjp Date: Wed, 18 Dec 2013 16:29:00 +0000 Subject: [PATCH] Use locale for output encoding. --- dbi/dumpsql | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dbi/dumpsql b/dbi/dumpsql index 8359365..c4929f1 100755 --- a/dbi/dumpsql +++ b/dbi/dumpsql @@ -20,6 +20,11 @@ use strict; use DBI; use Getopt::Long; use Encode qw(:fallbacks encode); +use I18N::Langinfo qw(langinfo CODESET); + +my $charset = langinfo(CODESET); +binmode STDOUT, "encoding($charset)"; + my $help; my $vertical; # use vertical output format