eevee/spline-pokedex — Issue #56: Break capitalized names in URLs
Author: encukou
Created: 2012-01-26 22:40:38+00:00
State: open
Labels: core, easy, low-priority

**Reported by [Eevee](http://github.com/eevee) on 2011/04/22 04:44:45 +0000 · Migrated from [Redmine issue 583](http://bugs.veekun.com/issues/583)**

---

e.g., \`/dex/pokemon/Eevee\`. This was never intended to work, and it’s leading to duplicate URLs which are a Bad Thing.

Probably nicer to redirect rather than outright 404.

Redmine metadata:
Updated on: 2011/04/28 02:53:55 +0000
Start date: 2011/04/22

---

**Comment by [En-Cu-Kou](http://github.com/encukou) from 2011/04/22 12:42:09 +0000**

This begs the question – what are the URLs?

If they’re supposed to be names (and part of the UI), capitalization shouldn’t matter, and they should redirect. But why redirect to `eevee` and not `Eevee`? The latter is the correct name, and if we support “nidoran♂” in the URL I don’t see why capital letters are a problem.
Let’s hope Nintendo doesn’t put [\#?/] in a name any time soon, BTW. `Imakuni?`, anyone?
Also, if they are names, they should be localized. But since the game language will be per-session, there’s a problem. (Current plan, discussed a few months back, is to use a preferred game language for each UI language; UI language is not per-session.)

If they’re not part of the UI, they should be identifiers. nidoran-f and mr-mime, case sensitive.

---

**Comment by [En-Cu-Kou](http://github.com/encukou) from 2011/04/27 22:44:54 +0000**

Also, the URL is a good place to *display* identifiers. Geeks need them for using the API or hacking on the data, so they *should* be exposed somewhere. The URL is a perfect fit, IMO.
Non-geeks don’t care about URLs.
Search engines will handle the mangling we use for identifiers just fine. Except the URLs wouldn’t match the content in non-English languages. Is that a big deal?

---

**Comment by [Eevee](http://github.com/eevee) from 2011/04/28 00:29:03 +0000**

I kinda like that URLs are really, really easy to determine. It’s hard to automatically construct URLs for most online Pokédexen. How do they handle Nidoran and periods and quotes and spaces durp?? veekun answer: they are in the URL literally, done. It’s perfectly possible, though awkward, to have a name with \`?\` in it (though I don’t think Routes handles \`/\` very well).

The names are lowercase because I think capital letters in URLs look bad. 8) The actual official names were ALL CAPS until very recently too. Might still be for some things; types?

ISTM that the session language should affect *what page you land on*, not *how that page renders*. Radically different responses for the same URL are rarely a good idea. Plus if you’re looking at the Japanese page for Eevee and want to link it to your buddy, you probably want him to *also* see it in Japanese and not have to hunt for the right country flag first. (Did we talk about this before and I conceded? I don’t remember :V)

I disagree about exposing the identifiers anywhere; if you’re hacking on something, you should just check the db or API or whatever to get them. Users should never need to know that we use identifiers at all. Query strings are sort of an unfortunate exception.

---

**Comment by [En-Cu-Kou](http://github.com/encukou) from 2011/04/28 02:53:55 +0000**

(If you’re tired of my yapping, use your BDFL powers – it’s your project and what you say goes, of course)

Eevee wrote:

> I kinda like that URLs are really, really easy to determine. It’s hard to automatically construct URLs for most online Pokédexen. How do they handle Nidoran and periods and quotes and spaces durp?? veekun answer: they are in the URL literally, done. It’s perfectly possible, though awkward, to have a name with \`?\` in it (though I don’t think Routes handles \`/\` very well).

Well, yeah, that is a rather nice property, yes. But consider a few points:

* Automatically constructing an URL from a pokémon name is a very specific thing to do. You might have been frustrated by it personally, but is it really worth optimizing for? And in the end, all you’ve done is become another online pokédex with another URL scheme which people will *still* have to check for the periods and ♀s and spaces to be sure. (Or ask on IRC. Haha. As if.) Your somewhat arbitrary choice of lowercasing everything doesn’t help convey the message of “vanilla official names”, either.

* Most people can’t even type the ♂ or é in their URL bar.

* Since veekun URLs aren’t plain ASCII, they might get mangled if people pass them around. Hepburn does this, for example: see [http://veekun.com/forums/5/threads/8](http://veekun.com/forums/5/threads/8). (not meant as *tu quoque*; I simply agree with that post and figured you might, too)

* URIs were designed as identifiers. “mr.%20mime” looks bad; “mr-mime” looks like a reasonable URL. (Luckily, nowadays brosers won’t show “nidoran%E2%99%82” to you.)

> The names are lowercase because I think capital letters in URLs look bad. 8) The actual official names were ALL CAPS until very recently too. Might still be for some things; types?

I think ♂s in URLs look bad. The other guy finds spaces ugly, the next one dislikes commas and quotes. We’re back to the beginning. If you’re going to use names, why not just use names?

> ISTM that the session language should affect *what page you land on*, not *how that page renders*. Radically different responses for the same URL are rarely a good idea. Plus if you’re looking at the Japanese page for Eevee and want to link it to your buddy, you probably want him to *also* see it in Japanese and not have to hunt for the right country flag first. (Did we talk about this before and I conceded? I don’t remember :V)

We did talk about this. The UI language should definitely be specified in the URL, as you said above (also, I need to be able to link to a positively Czech page on my Czech site).
Pokémon names are in the game language, though: they don’t even exist in other languages than the games. We decided to have the game language in the session.

> I disagree about exposing the identifiers anywhere; if you’re hacking on something, you should just check the db or API or whatever to get them. Users should never need to know that we use identifiers at all.

I dare to disagree.
I am a pokédex hacker. A pokémon reseacher, if you will. I think this is a very valid role for a pokédex user.
For me, identifiers are a very important part of pokédex information.
I personally want to see identifiers on veekun. I want to eat the dogfood. I want to use the site’s rich, general data alongside my poor man’s CLI script designed to solve a specific problem. If the identifiers were on the site, I could use an advanced lookup mechanism designed for dead-easy, setup-free access to get them.
Also, not as importantly, I could copy the input/output right from/to the URL bar. I could even construct those links easily (given I’m using veekun data, of course – but is there anything else, and if there was, would its powerusers appreciate the fact that they can link to veekun easily?). Going straight from `/dex/pokemon/eevee` to `/dex/pokemon/search.json?eevee` is also mentionable.
So yes, there’s a (small) group of users that could use identifiers in URLs.
For ordinary users, on the other hand, URLs have no value – especially if they can’t even type the ♂s in. Users want to use the shiny lookup box for friendly input and the

/

<h1>
for friendly output.
The names do make automatic linking to veekun from another pokédex easier, yes. But the identifiers aren’t that hard to figure out, either. And if you value competing pokédex makers over people using your data… something’s wrong.

And that’s most of what I have to say bout that.

> Query strings are sort of an unfortunate exception.

There’s no technical reason to make an exception out of them, is there? If there’s names in the URLs, those should be names as well IMO.