trailing whitespace in strings

Bastian, Waldo waldo.bastian at intel.com
Tue Nov 21 13:12:37 PST 2006


KDE ignores trailing spaces. I'm ok to mandate that in the spec if
someone can provide a patch for Gnome/Gtk to do the same. 

Cheers,
Waldo
 
Intel Corporation - Channel Platform Solutions Group - Hillsboro, Oregon

>-----Original Message-----
>From: xdg-bounces at lists.freedesktop.org [mailto:xdg-
>bounces at lists.freedesktop.org] On Behalf Of Ralph Giles
>Sent: Tuesday, November 21, 2006 11:25 AM
>To: xdg at lists.freedesktop.org
>Subject: trailing whitespace in strings
>
>Apologies if this has been discussed; I couldn't find the actual
>decision in the archives.
>
>The 0.9.8 desktop entry spec says that 'Space before and after the
>equals sign should be ignored' but says nothing about trailing
>whitespace. glib, it seems, interprets this as 'trailing whitespace
>is part of a string value'.
>
>However, this violates general practice of human-editable config files,
>where whitespace is minimally relevent. In particular, see
>
>  https://maemo.org/bugzilla/show_bug.cgi?id=859
>
>where at least two of us have lost developer time because our editors
>didn't indicate trailing whitespace in a .desktop string value, and it
>took a while to discover the parser thought it was meaningful.
>
>I would further argue that having meaningful trailing whitespace isn't
>especially useful. The spec defines a string type as containing 'all
>ASCII characters except for control characters' so this type can't be
>used for binary blobs. If trailing spaces in an ASCII value are
required
>for by an application they can still be included using the '\s' escape
>sequence.
>
>Therefore I would suggest changing the spec to indicate that leading
>and trailing whitespace be stripped from values, just as trailing
>whitespace (well 'space', I guess tab is a control character?) is
>current stripped from keys and leading whitespace is stripped from
>values. In the common case this will be more efficient in developer
>time and removes no functionality from the design.
>
>(On a related note, the 0.9.8 spec also says 'desktop entry files are
>encoded as lines of 8 bit characters', which conflicts with both the
>definition of the string and localestring types assuming the usual
>unicode definition of 'charater'. Perhaps it should say '8 bit bytes'
>or '8 bit chars'?)
>
> -r
>_______________________________________________
>xdg mailing list
>xdg at lists.freedesktop.org
>http://lists.freedesktop.org/mailman/listinfo/xdg



More information about the xdg mailing list