[josm-dev] control characters in config file
Dirk Stöcker
openstreetmap at dstoecker.de
Wed Dec 29 12:25:19 GMT 2010
On Wed, 29 Dec 2010, Frederik Ramm wrote:
> I am slightly unhappy about the fact that we have control characters (more
> specifically, the "record separator" 0x1e - someone must really have read
> their standards) in the config file. This means that I cannot simply email
> someone and say "add this line to your config file" (e.g. to support a new
> imagery source).
>
> I would like to change that to a semicolon. (Plan: prepend config file with a
> line that goes @version=something, so we can see whether we have an old-style
> or new-style file, support old-style on reading but only new-style on
> writing, escape any existing semicolons and backslashes with a backslash.)
>
> Any objections? Or does someone maybe have plans for a grand re-write of the
> config file code anyway, maybe changing to "ini" file syntax, XML, or YML?
> The countless "config.option.0"-style entries cry out for some structured
> config file format but I'm not a big fan of XML configs...
Yes. I used 0x1E (and yes, I know my standards), as semicolon had lots of
troubles, same with comma and everthing else. E.G. the commit comments use
all of these characters. Previously it has been ';' as well as ',' and
some forms of §.
The advanced preferences allow to enter fields as well. Generally directly
editing the josm config-file is not a recommendable thing anyway and if
the person doing so cannot cope with the 0x1E, then he should use the JOSM
GUI interface.
BTW: Sending 0x1E by mail is usually no problem - it is a ASCII character
(and thus also a valid UTF-8 character).
I really did think a lot about what record separation we should use and
the 0x1E is the best we can reach without going to a XML format (which
would be a lot of work for only little benefit). And it took a long time
to get rid of old config handling as well and replace it by a standard
interface.
So yes, there is a big objection against changing this back.
There is already a ticket about a way to change config using a
specification file (like e.g. .reg files do for windows registry).
Implementing this would solve your problem in the right way. This means
creating and implementing an XML file, which can be given to JOSM to
change certain JOSM settings in a user-friendly way.
Ciao
--
http://www.dstoecker.eu/ (PGP key available)
More information about the josm-dev
mailing list