[OSM-dev] [Talk-GB] OSM shortlinks problem

Matt Amos zerebubuth at gmail.com
Tue Mar 30 00:28:41 BST 2010


On Mon, Mar 29, 2010 at 11:34 PM, Gregory <nomoregrapes at googlemail.com> wrote:
> On 29 March 2010 15:15, Matt Amos <zerebubuth at gmail.com> wrote:
>>
>> http://trac.openstreetmap.org/changeset/16271
>>
>> yeah, it was originally =, but changed to - to work with twitter.
>> given that the characters A-Z, a-z, 0-9, _, @, - and = have already
>> been used, what's the next best character? ~? +?
>
> Well I suggested that you remove problematic symbols, and just use A-Z, a-z,
> 0-9 if need be.

we're already using those symbols in a way that makes it difficult to
reuse them for trailing characters without breaking existing links.
if anyone can find a character which isn't in the list above, and
doesn't break at least one URL-detector out there, then that's the
best way to fix this.

the alternative is to use some other scheme, for example appending
.1/.2 instead of -/-- which makes some zoom levels a char longer. or
possibly pre-pending the dashes, since they're usually picked up in
the middle of an URL - but this makes char deletion from the end work
slightly differently.

it's also worth noting that, in the current scheme, shortlinks can end
in @ or _ - do these also break the URL detectors?

> Hmm, sorry Matt I see you only sent to Dev so might have missed the
> discussion on Talk-GB.

gmail seems to be clever enough to bring it into the thread. but i
figured this was a development discussion, so better to keep it here.

> It was said (if we have powers over Google, Microsoft, and other big e-mail
> applications) we tell them to change...
> It's also allowed behaviour. '-' is a valid URI character, so any user
> agent that chops them off the end of a URI is broken. I realise that
> doesn't help the people using them, but it would be better to fix the
> problem in the correct place.

sure, and if someone can find a char which works in more clients than
-, it's an easy fix.

> Robert Scott referenced RFC4648 base32 and said we could change it to =
> perhaps (changing it back and breaking twitter again!).

using = still works, so if that's working better then i guess a quick
fix is to edit it manually...

> Steve Doerr wondered if replacing it with %2D would solve it. I'm not sure
> at what point it would be best to do this (in the link or manually).

it might do, but the idea of shortlinks is that they're short and, if
possible, easy to type on an ascii keyboard. but it seems like a
difficult brief to fill. ;-)

cheers,

matt




More information about the dev mailing list