From 5c22ddc57cb44faf96e5bf473b086c8f752139eb Mon Sep 17 00:00:00 2001 From: Bert Date: Fri, 6 May 2011 18:31:52 +0200 Subject: [PATCH] clipboard: use locale_encode, thanks XeCycle --- clipboard | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/clipboard b/clipboard index 01ad530..c753090 100644 --- a/clipboard +++ b/clipboard @@ -37,8 +37,7 @@ sub paste { my $str = `xsel -ob`; if ($? == 0) { - $str =~ tr/\n/\r/; - $self->tt_write($str); + $self->tt_paste($self->locale_encode($str)); } else { print STDERR "Error running xsel: $!\n"; } @@ -51,9 +50,8 @@ sub paste_escaped { my $str = `xsel -ob`; if ($? == 0) { - $str =~ tr/\n/\r/; $str =~ s/([!#\$%&\*\(\) ='"\\\|\[\]`~,<>\?])/\\\1/g; - $self->tt_write($str); + $self->tt_paste($self->locale_encode($str)); } else { print STDERR "Error running xsel: $!\n"; }