Re: backwards compatible .desktop files



On 1/18/02 3:32 PM, "Owen Taylor" <otaylor redhat com> wrote:

> Darin Adler <darin bentspoon com> writes:
> 
>> On 1/18/02 3:02 PM, "Owen Taylor" <otaylor redhat com> wrote:
>> 
>>> But since the KDE desktop files and old GNOME desktop files don't have
>>> it, the approach to "is UTF8" is simple. If the entire file is valid
>>> UTF-8, then the desktop file is in UTF-8. This turns out to be a very
>>> accurate.
>> 
>> Is there a good reason not to do this heuristic in g_filename_to_utf8 when
>> G_BROKEN_FILENAMES is not set?
> 
> An accurate heuristic is impossible, plus, more importantly, heuristics
> don't work round-trip.

Conversion of an arbitrary filename to valid UTF-8 also doesn't work
round-trip, so this doesn't matter for Nautilus -- I can see how it might
matter for other g_filename_to_utf8 users.

Does g_filename_to_utf8 maybe have to validate the string it dups in the
case where it just does a g_strdup? I'm a little concerned that we don't
have examples of using this in real programs and are missing these
subtleties because of that.

You first said that "this turns out to be a very accurate" about the
heuristic, then you said "an accurate heuristic is impossible".

    -- Darin




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