Last modified: 2011-03-13 18:06:47 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 10685 - Automatically hyphenate ISBNs
Automatically hyphenate ISBNs
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
All All
: Lowest enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
  Show dependency treegraph
Reported: 2007-07-24 20:39 UTC by Jean-Sébastien Girard
Modified: 2011-03-13 18:06 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Description Jean-Sébastien Girard 2007-07-24 20:39:54 UTC
It should be easy enough to do: ISBN ranges are very documented and a parser should be doable. See for the list. Besides, theoretically, the proper way to display ISBNs is with hyphens.
Comment 1 Michael Daly 2007-07-24 22:46:51 UTC
Looking at the documentation, that isn't a trivial task - straightforward, but not trivial.  Since there are old 10 digit ISBNs still in use and new 13 digit ISBNs, should both sets of rules be used or should only the new 13 digit ISBNs be processed?

According to the ISBN web site, either hyphens or spaces are appropriate.
Comment 2 Jean-Sébastien Girard 2007-07-25 01:48:29 UTC
But I don't think Mediawiki actually support spaces. And the hyphenation is identical for isbn-10 and -13. ISBN-13 do not change hyphenation.They only add the 978- prefix (and may alter the check digit, but that is beyond the scope of hyphenation).
Comment 3 Randolph Finder 2009-06-04 13:30:26 UTC
I would like to help program this if possible? I also found everything needed to determine the proper spacing for either an ISBN-10 or ISBN-13 regardless of which nation. Does the WONTFIX indicate that a decision has been made that this shouldn't be done?
Comment 4 Happy-melon 2009-06-04 16:10:55 UTC
It was WONTFIXed by a senior dev (Rob Church), but with no comment.  I can't see any particular reason why this *shouldn't* be done (although I could well be missing something given the close).  Certainly nothing will be committed without his OK, but if you want to spend the time on it, go ahead; if you can do it cleanly and efficiently, that might resolve whatever issue it was WONTFIXed for. 
Comment 5 Randolph Finder 2009-06-04 17:01:15 UTC
What language is development in, PHP? The program would primarily be referencing the tables at and the code would look something like (Don't want to copy it directly, but definitely right idea. :)

The way that the table would be referenced for ISBN-10 is to find the line that has the first piece of the ISBN in the first column, where the next chunk is between the two next fields, and then also cut before the check digit, so 4789654321 would be hyphenated after the 4 (since 4 is in the first column alone, and then after the 7896 since since 7896 is between 7000 and 8499 and then before the 1 (assuming 1 is the appropriate check digit) and would become 4-7896-5432-1. For ISBN-13 just put the initial 978 in its own group. It may also make sense as part of the same effort to figure out how to react on either mislength or mischeckdigit situations.

Comment 6 Happy-melon 2009-06-05 09:24:48 UTC
Yes, MediaWiki is written almost entirely in PHP; our coding conventions are set out at [[mw:Manual:Coding conventions]], although they are not prescriptive. 
Comment 7 Randolph Finder 2009-06-05 13:13:51 UTC
Clicking on that link gave me a "Bad Title" page, could you please check on it? Thank You.
Comment 8 Happy-melon 2009-06-05 13:55:45 UTC
Ah, seems that mw is not a local interwiki prefix on wikipedia.  The full url is

Note You need to log in before you can comment on or make changes to this bug.