Bug 52371 - Extra "%20" added at the end of links
Summary: Extra "%20" added at the end of links
Status: RESOLVED FIXED
Alias: None
Product: klipper
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Mandrake RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Carsten Pfeiffer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-12-29 00:15 UTC by ndeb
Modified: 2006-11-23 02:55 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ndeb 2002-12-29 00:15:10 UTC
Version:           v0.9.5 (using KDE 3.1.0 (RC5))
Installed from:    Mandrake Linux Cooker i586 - Cooker
Compiler:          gcc version 3.2 (Mandrake Linux 9.0 3.2-1mdk)
OS:          Linux (i686) release 2.4.19-16mdk

Highlight a link on a term (konsole, xterm). Klipper pops up window to open the link. Open the link in konqueror. The link opened now has an extra "%20" added at the end. Naturally, that link is not a valid link which means the very purpose of opening the link is defeated. One has to manually delete these extra characters to correct the link and then load it.
Comment 1 Carsten Pfeiffer 2002-12-29 11:34:55 UTC
Subject: Re:  New: Extra "%20" added at the end of links

On Sunday 29 December 2002 00:15, you wrote:

> Highlight a link on a term (konsole, xterm). Klipper pops up window to open
> the link. Open the link in konqueror. The link opened now has an extra
> "%20" added at the end. Naturally, that link is not a valid link which
> means the very purpose of opening the link is defeated. One has to manually
> delete these extra characters to correct the link and then load it.

Are you sure the %20 appears when highlighting a URL in konsole and not in 
khtml (konqueror, kmail, ...)? Or maybe it happened that you marked not only 
the URL but some extra space. In that case you may want to use the handy 
double-click feature of konsole (and probably any other terminal):

double-click the URL and if necessary, move the mouse to the rest of the URL 
if not everything was selected by the double-click (still holding down the 
mousebutton).

Klipper surely doesn't add anything to the selected text.

Cheers
Carsten Pfeiffer
-----BEGIN PGP SIGNATURE-----

iQEVAwUBPg7PRaWgYMJuwmZtAQH8kQgAj8ISSLl0OJZeXYZsMMhNe2FMgJ0emjmA
TY8Ei4eGhlIVCJ52O9aIbYUhfLup39eL+l5Z4aKA9b6/YDtDp73bAQ9n/ut3b260
hbu741WWxotUGCvo2RqvfEl4EIz0kqb/+HL2Fk7DE85ZhD0zNbNUtnkv1x1yN6Xv
tyyxrmlXmaQSlkaFfEzWs58d9HUQN1Hf2OUTjzF3TXEXvQJCr0XhJHXMN4XHZYkV
XrY5Uf7+WrtxdnwC+MaUypWjMSWAuvVhePuJgbKMotz2wVX2QqmujYutukeHYEUD
1cBot/3eKvo1u4FzZIrMzsk5jsNc0hRYE+X1HaB3wptXr7kx8o4mdA==
=ScKW
-----END PGP SIGNATURE-----

Comment 2 ndeb 2002-12-29 18:02:35 UTC
Subject: Re:  Extra "%20" added at the end of links         

On 29 Dec 2002, Carsten Pfeiffer wrote:

> ------- Additional Comments From carpdjih@mailbox.tu-berlin.de  2002-12-29 11:34 -------
> Subject: Re:  New: Extra "%20" added at the end of links
> 
> On Sunday 29 December 2002 00:15, you wrote:
> 
> > Highlight a link on a term (konsole, xterm). Klipper pops up window to open
> > the link. Open the link in konqueror. The link opened now has an extra
> > "%20" added at the end. Naturally, that link is not a valid link which
> > means the very purpose of opening the link is defeated. One has to manually
> > delete these extra characters to correct the link and then load it.
> 
> Are you sure the %20 appears when highlighting a URL in konsole and not in 
> khtml (konqueror, kmail, ...)? 

konsole

> Or maybe it happened that you marked not only 
> the URL but some extra space. 

Ur guess is right. The "%20" is added only when there is an extra space at
the end, not otherwise.

> In that case you may want to use the handy 
> double-click feature of konsole (and probably any other terminal):
> 
> double-click the URL and if necessary, move the mouse to the rest of the URL 
> if not everything was selected by the double-click (still holding down the 
> mousebutton).

Thats what I do but there is always a chance of overshoot when u
move the mouse to the rest of the URL (which adds the extra space at the
end).

> 
> Klipper surely doesn't add anything to the selected text.

Can klipper subtract the extra terminal space from selections that start
with http/s, ftp/s, file  etc. ?


> 
> Cheers
> Carsten Pfeiffer

Comment 3 Carsten Pfeiffer 2002-12-29 18:59:00 UTC
> Can klipper subtract the extra terminal space from selections that start  
> with http/s, ftp/s, file etc. ?  
  
It could do that optionally, yes. Well, it's a quick fix, so there it is in CVS now. 
(will be in the next major version after 3.1, because it added new strings to 
be translated). 
Comment 4 kjetilho 2006-11-23 02:53:19 UTC
This is nice, but I would like to see it extended.  Often I read messages in e-mail or news which have URLs which are broken by the poster or the quoting.  I have worked around it by making my own wrapper, but it would be nice if Klipper did it automatically.  After all, newline, space and ">" are illegal in URLs.

Here it is, it's quite simple :-)

#! /usr/bin/perl
# Remove line breaks.  Also remove a trailing backslash before the linebreak
# (e.g. emacs -nw), leading whitespace, and ">" (quoted e-mail).
$ARGV[0] =~ s/\\?\n[\s>]*//;
exec "kfmclient", "exec", @ARGV;

now, you could argue that it's not clean to make such a modification for %s depending on the pattern, and that kfmclient should do it instead, and I would agree.  perhaps a %u (for URL) could be introduced instead.