Re: [Nautilus-list] [PATCH] Custom icon patch

On 04 Jun 2001 15:05:00 -0700, Darin Adler wrote:
> On Monday, June 4, 2001, at 12:36  PM, Anders Carlsson wrote:
> > today I noticed that when I tried to set the custom icon of a directory
> > by dragging the icon to the sidebar icon of the directory, it wouldn't
> > work if the icon file contained ,  or .
> >
> > [...]
> >
> > The best solution for this is probably to escape the string before
> > setting metadata, so here's a patch that does that.
> The patch seems like the right direction. Note that we are working around 
> a bug in libxml 1 here. We shouldn't have to escape characters to have 
> them survive the roung trip into the metafile. I do have three remarks 
> though:
> 1) It seems that the escaping should go inside the metdata machinery, not 
> in the code to set this one particular piece of data.
> 2) This patch escapes the name the way into metadata, but where's the code 
> to unescape on the way out?
> 3) Why did you chose gnome_vfs_escape_host_and_path_string over 
> gnome_vfs_escape_string? Perhaps we need an escape function that only 
> escapes non-ASCII characters.

Well, gnome_vfs_escape_host_and_path still gives a valid uri so that's
why it works. However, I see now that, just like you say,  doesn't
work as metadata in other places (for example, the annotation).

So, my next solution would probably be to write a special xmlGetProp
function that would traverse the xmlAttrPtr tree and unescape any
occuring entities. How does that sound?

> Finally, what would you envision doing for the GNOME 2 time frame when we 
> have the newer fixed version of libxml?

Since xmlGetProp in libxml2 returns the entities unescaped in utf8
format this should be no problem.
For URL cases, functions for converting between utf8 filenames and
gnome-vfs uris are probably needed, and for other cases (like the
annotations) we should just be fine since we can display such text with

>      -- Darin

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