[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kmail-devel
Subject:    Re: [PATCH] Don't interpret "mailto: ", "ftp: " et al. as links
From:       Michael Haeckel <Michael () Haeckel ! Net>
Date:       2001-07-13 9:50:00
[Download RAW message or body]

On Friday, 13. July 2001 15:35, Marc Mutz wrote:
>
> a. if we encounter ://, try to match any string prot in protocols() to
> the substring of the message body starting prot.length() before "://",
> and if we have a match, replace the already written-to-HTML protocol
> identifier with <a href=...>blah...
>
> b. if we encounter whitespace, we start looking for a protocol match,
> sorting out the impossible protocols on the way. If we have a match, we
> check whether the substring up until the next whitespace forms a valid
> URL (we have validators for that in kdelibs)  and if yes, we substitute
> a <a href> tag, else we copy verbatim.
>
> IMHO, (b) is the Right Way, but requires deeper changes in that parser
> than is desireable so near a final release.

I still prefer method (a). Whitespace characters are much more common in 
mails, than ":" characters or urls. I don't think, that method (b) would be 
faster though, if it tries to match an url on every word.

> <snip>
>
> > BTW: I have already a patch ready, that finally changes this code to
> > use QString intead of this toUtf8 -> parse it -> back to unicode
> > hack.
>
> <snip>
>
> I never understood why this code works except for latin1 or very
> similar. It must fail horribly when UTF8 escape sequences come into
> play, musn't it?

No, that works well. All utf-8 representations of characters, that are not 
us-ascii contain only characters above 0x80.

Regards,
Michael Häckel
_______________________________________________
Kmail Developers mailing list
Kmail@master.kde.org
http://master.kde.org/mailman/listinfo/kmail

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic