There are two things that would have helped:
- I'd never gotten into the situation in the first place if processing info.json would work the same locally as on the mod portal. The mod version with the illegal characters in its name worked perfectly while I used the local copy I was working on. It's not expected behavior that the same mod can't be submitted to the mod portal. The easiest way to fix this that I can imagine: the local game would run the same checks on info.json as the modportal does and give a warning (or exit with an error) if anything is wrong with it.
- An additional test: Read info.json, extract the "name" field, and compare it to the name of the zip-file (without the file extension) and the directory contained in it. Bail out with an error if there is a difference. Obviously, info.json must already be parsed when a mod is submitted -- otherwise, the mod portal wouldn't have known about the illegal characters. So, according to my naive thinking, one more little test shouldn't be hard to implement.
ADDENDUM:
There is no tutorial dedicated to info.json. However, there is a short section on that file here. It's not really detailed, though. This is all it says about the "name" field:
I think it would be a good idea to put up some more information on the Wiki: What characters are not allowed in "name"? What is the correct syntax for dependencies (not just "modname", but also "? modname", "(?) modname", and "! modname")?This is the internal name of your mod, it is used to identify your mod in code.