Re: FMPS v1.0 and triple colon escaping

7 views
Skip to first unread message

Jeff Mitchell

unread,
Sep 17, 2010, 8:02:54 AM9/17/10
to Quentin Sculo, x...@lists.freedesktop.org, fm...@googlegroups.com
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

signature.asc

Jeff Mitchell

unread,
Sep 27, 2010, 12:44:17 PM9/27/10
to Quentin Sculo, x...@lists.freedesktop.org, fm...@googlegroups.com

Quentin,

As nobody else seems to have an issue with it (or care? :-) ) I'll
release an updated spec that escapes all :, ;, and \. It'll still use ::
and ;; for list/field separators; escaping will be done in identifiers
and field values only.

Does that sound good?

--Jeff

signature.asc

Jeff Mitchell

unread,
Sep 28, 2010, 11:48:38 AM9/28/10
to Quentin Sculo, x...@lists.freedesktop.org, fm...@googlegroups.com
On 9/27/2010 5:58 PM, Quentin Sculo wrote:
> Yes, I think it's better that way. There was also a problem with values
> ending with ";" or ":".
>
> Sorry about not having mentioned this problem earlier, I only noticed it
> when I started implementing it.
>
> On another subject, I'm interested in a standard to save :
> - list of labels/tags
> - skip count
> - last played/skipped date
> - list of played/skipped dates

Sounds good. Want to work with me on FMPS v1.1?

By the way, what player/app/library are you working on?

Thanks,
Jeff

signature.asc
Reply all
Reply to author
Forward
0 new messages