From af2a6460d3477b48c96ed89d4eb7805fba0663e9 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Mon, 16 Mar 2009 13:34:32 +0000 Subject: [PATCH] we need to unset LANG if we don't want to corrupt encoding --- bin/ldap-rewrite.pl | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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', -- 2.20.1