From: Dobrica Pavlinusic Date: Mon, 16 Mar 2009 13:34:32 +0000 (+0000) Subject: we need to unset LANG if we don't want to corrupt encoding X-Git-Url: http://git.rot13.org/?p=virtual-ldap;a=commitdiff_plain;h=af2a6460d3477b48c96ed89d4eb7805fba0663e9;ds=sidebyside we need to unset LANG if we don't want to corrupt encoding --- diff --git a/bin/ldap-rewrite.pl b/bin/ldap-rewrite.pl index 4e2d55e..23e790b 100755 --- a/bin/ldap-rewrite.pl +++ b/bin/ldap-rewrite.pl @@ -131,10 +131,6 @@ sub run_proxy { die "Could not create listener socket: $!\n" unless $listenersock; die "Could not create connection to server: $!\n" unless $targetsock; - # mark sockets as binary - binmode( $listenersock ); - binmode( $targetsock ); - my $sel = IO::Select->new($listenersock); my %Handlers; while (my @ready = $sel->can_read) { @@ -157,6 +153,8 @@ sub run_proxy { } +$ENV{LANG} = 'C'; # so we don't double-encode utf-8 if LANG is utf-8 + my $listenersock = IO::Socket::INET->new( Listen => 5, Proto => 'tcp',