Re: [evolution-patches] IDN patch for evolution head



On Mon, 2004-01-05 at 14:07 -0800, Suresh Chandrasekharan wrote:
> Here is the problem,
> 
> camel-http-stream.c:
> 
> static CamelStream *
> http_connect (CamelHttpStream *http, CamelURL *url)
> {
>         CamelStream *stream = NULL;
>         struct hostent *host;
>         int errsave;
> 
>         if (!strcasecmp (url->protocol, "https")) {
> #ifdef HAVE_SSL
>                 stream = camel_tcp_stream_ssl_new (http->session, url->host,
>                 					          ^^^^^^^^^								 
>                  SSL_FLAGS);
> #endif
> 
> 
> 
> and 
> 
> host = camel_gethostbyname (url->host, NULL);
>                             ^^^^^^^^^
>                             
> These can't be utf8_hosts....

Yes, indeed.  Thats why you add a method to get the encoded host, and
change the few places its used.

Obviously, adding functionality, something has to change.

Sure you could just keep both around all the time too ... *shrug*, it
depends on how expensive it is and how often its used.  Can the code
automagically determine if a hostname is ace format vs plain ascii?

> 
> 
> >
> >like what? where is this a problem?
> >
> >> 
> >> I can make utf8_host set always.
> >
> >what I want to see is no camel files changed except camel-url.c (and, if
> >necessary, camel-url-scanner.c)
> >
> 
> Currently the logic for determine the end of a valid url only considers ASCII 
> character, suppose that you have a link in a received like follows
> 
> http://<multibyte host>/index.htm
> 
> within a mail, that link need to be active when viewed in mail window (should be 
> clickable), currently 8bit characters are not treated as valid hostnames. This 
> logic takes in each utf8 charcter of the hostname and will check whether each 
> utf8 charcter is fit to be as a part of a hostname, each utf8 character will be 
> converted to ASCII compatible encoding and will be checked.

Is there an easier way to do this check?  e.g. unicode is_alnum or
equivalent.  since it is only approximate anyway.






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]