clipboard: use locale_encode, thanks XeCycle
This commit is contained in:
parent
ea7118fc9e
commit
5c22ddc57c
@ -37,8 +37,7 @@ sub paste {
|
|||||||
|
|
||||||
my $str = `xsel -ob`;
|
my $str = `xsel -ob`;
|
||||||
if ($? == 0) {
|
if ($? == 0) {
|
||||||
$str =~ tr/\n/\r/;
|
$self->tt_paste($self->locale_encode($str));
|
||||||
$self->tt_write($str);
|
|
||||||
} else {
|
} else {
|
||||||
print STDERR "Error running xsel: $!\n";
|
print STDERR "Error running xsel: $!\n";
|
||||||
}
|
}
|
||||||
@ -51,9 +50,8 @@ sub paste_escaped {
|
|||||||
|
|
||||||
my $str = `xsel -ob`;
|
my $str = `xsel -ob`;
|
||||||
if ($? == 0) {
|
if ($? == 0) {
|
||||||
$str =~ tr/\n/\r/;
|
|
||||||
$str =~ s/([!#\$%&\*\(\) ='"\\\|\[\]`~,<>\?])/\\\1/g;
|
$str =~ s/([!#\$%&\*\(\) ='"\\\|\[\]`~,<>\?])/\\\1/g;
|
||||||
$self->tt_write($str);
|
$self->tt_paste($self->locale_encode($str));
|
||||||
} else {
|
} else {
|
||||||
print STDERR "Error running xsel: $!\n";
|
print STDERR "Error running xsel: $!\n";
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user