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

List:       kde-devel
Subject:    Re: Q: The dimension of UNICODE awareness
From:       Dawit Alemayehu <adawit () earthlink ! net>
Date:       1999-10-14 21:40:27
[Download RAW message or body]

On Thu, 14 Oct 1999, David Faure wrote:
> On Thu, Oct 14, 1999 at 10:19:37PM +0900, Woohyun JANG wrote:
> > On Thu, Oct 14, 1999 at 12:49:10PM +0200, Waldo Bastian wrote:
> > : 
> > : Great. So they basically say the same, do Unicode -> UTF8 and then go
> > : from UTF8 to URL-encoding.
> > : 
> > : This means that the URL of a korean filename looks like shit. So I
> > : think we should distinguish between the "URL encoding according to the
> > : RFCs" and a "printable URL". In the printable version we can unescape
> > : everything as long as it remains unambiguous (We should still escape
> > : ":", "/" , "?" and maybe a few others.)
> > : 
> > : so we would get e.g.
> > :    QCString KUrl::url() 
> > : and 
> > :    QString KUrl::printableURL()
> > : 
> > : Opinions?
> > 
> > Great idea! 
> 
> Yes, what a great idea.
> I just had it three months ago :))
> 
>  
> >From kurl.h :
> 
>   /*
>    * convenience method
>    * @return the complete decoded URL, for instance to be displayed to the user.
>    */
>   QString decodedURL() const { QString s = url( 0 ); decode( s ); return s; }   

Almost :(  However, the concept of encoding ( which actually should be called
escaping, because that is what it actually is ) is totally flawed in the old as
well as the new KURL.  You cannot encode and decode a URL as a whole.  this
might work well for local URL's ( file:/ ) since they mostly contain path
information only, but it would be completely wrong for URL with a hostname
which means it is wrong for all http, ftp etc protocols.  You first have to
break up the URLs into each of the relevant segments ( protocol, host, port,
path, query, reference ...) before you can escape excluded characters.

Sorry to be a nitpick David, but you are right in that you had the general idea
before anyone else ;-)

Regards,
Dawit A.

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

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