FMPS v1.0 and triple colon escaping

Jeff Mitchell mitchell at kde.org
Fri Sep 17 05:02:54 PDT 2010


On 09/17/2010 01:12 AM, Quentin Sculo wrote:
> Hi
> I'm implementing parts of the FMPS specs, and I'm wondering about the
> escaping of lists.
> How is a string such as ":::" (3 colons) escaped ?
> 1) "\:\::"
> or
> 2) "\:\:\:"
> The specs only talk about escaping double colons (and double
> semicolons), so that would mean 1) but 1) is difficult to split correctly.

1) is the correct answer, according to the spec, but I see why you say
that it's more difficult to split correctly. I wish you'd brought this
up earlier sometime in the past year of the spec's development... :-)

> I realize strings such as ":::" are not a very common occurrence, but
> I'm sure some lyrics contain it.
>
> Personally I would prefer to escape all ";", ":" and "\" with a "\",
> simple and effective.

This was discussed at some point but that solution wasn't preferred,
because you still have to do a replacement over the string, and it makes
it less readable for the far more common case of single colons or
semicolons. We were also trying to keep it simple in that escaping a
block of two \:\: characters is not something you will likely find
anywhere else, whereas possibly you'll find \: somewhere -- so then do
you escape the escape, and have \\\: if you actually want a backslash
and a colon? (IOW we didn't want to get into escaping hell.)

However, I don't think anyone thought of how the triple-colon case makes
the splitting harder. I also don't think that it's likely that you'll
find \: or \; as a literal string in lyrics; I think you're more likely
(although still not likely) to see :::

Considering that 1.0 was just released, implementation can't be *too*
far progressed for those working on it, so it probably wouldn't be too
big a burden to issue a v1.0.1 and change the behavior. I'd like to see
if others have opinions on the matter -- what do others think; should we
change to #2 above?

Thanks,
Jeff

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/xdg/attachments/20100917/17a42c63/attachment.pgp>


More information about the xdg mailing list