Valid urls

Anything about use of this forum : NOT about cycling
Post Reply
Abradable Chin
Posts: 330
Joined: 7 Aug 2016, 7:38pm
Location: Peripatetic

Valid urls

Post by Abradable Chin »

[url=https://en.wikipedia.org/wiki/Nickel–iron_battery]Why isn't this URL allowed[/url]?It seems to have an en-dash in it (ascii 150D)
User avatar
gaz
Posts: 14648
Joined: 9 Mar 2007, 12:09pm
Location: Kent

Re: Valid urls

Post by gaz »

Abradable Chin wrote:[url=https://en.wikipedia.org/wiki/Nickel–iron_battery]Why isn't this URL allowed[/url]?It seems to have an en-dash in it (ascii 150D)

AIUI the forum software is an open source package which apart from adding the branding has minimal alteration from the out of the box package. Helps keep costs down within the shoestring budget Cycling UK allocate to running the forum.
Work around.
High on a cocktail of flossy teacakes and marmalade
drossall
Posts: 6115
Joined: 5 Jan 2007, 10:01pm
Location: North Hertfordshire

Re: Valid urls

Post by drossall »

This works.

You're right; its the n-rule that's not valid in an URL (here or anywhere else). You need to use the dash (ASCII-45). Not sure how you got an n-rule into that URL?
Abradable Chin
Posts: 330
Joined: 7 Aug 2016, 7:38pm
Location: Peripatetic

Re: Valid urls

Post by Abradable Chin »

It's the official URL. The minus-sign one redirects to the en-dash one, fortunately.
drossall
Posts: 6115
Joined: 5 Jan 2007, 10:01pm
Location: North Hertfordshire

Re: Valid urls

Post by drossall »

If it's got an illegal character, then it's not an URL. Try encoding the offending character:
https://en.wikipedia.org/wiki/Nickel%96iron_battery

What I think is happening is that Wikipedia links are built from the names of its articles. Those can contain special characters. URLs can't. So, Wikipedia transliterates. If you're quoting the page outside Wikipedia, you need the transliterated URL (with a normal dash) or the encoded one, as above.

More details on Wikipedia page names and URLs.
Post Reply