[josm-dev] control characters in config file
Dirk Stöcker
openstreetmap at dstoecker.de
Wed Dec 29 13:34:51 GMT 2010
On Wed, 29 Dec 2010, Frederik Ramm wrote:
> Why did you not go with a semicolon and escape it when it occurred elsewhere?
> Given that 0x1E is a valid character that might conceivably appear inside a
> value, you must have some sort of escaping rule anyway - why not apply the
> same escaping rule but use a semicolon.
Well, there are no escaping rules yet. We simply assume that 0x1E does not
occur in user entered texts. Nobody said this is perfect :-)
>> BTW: Sending 0x1E by mail is usually no problem - it is a ASCII
>> character (and thus also a valid UTF-8 character).
>
> Surely you are joking. It may be possible to send it but even if it isn't
> mangled by a non-standards-compliant user agent, it would be killed in
> copy-and-paste. Plus I'd have to add a paragraph to my email about how to
> enter that character with your keyboard in your preferred editor in case they
> wanted to do so by hand.
No. I had no troubles copy&pasting 0x1E in the editors I use (and I use a
lot of editors). I did this all the time before I adapted the advanced
preferences to properly handle collections.
I don't know how to enter it by hand. I always used copy&paste :-)
>> 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
>
> I disagree. I think that a semicolon is better than 0x1e.
Well, we had lot of troubles with comma and semicolon, but till now there
was no trouble with the 0x1E, so I assume you are wrong here.
>> 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.
>
> My problem is that there are unnecessary control characters in what would
> otherwise be a nice plain text file.
It is anyway UTF-8, so there can be any characters in the range 0x80 to
0xA0 which lots of software also considers to be control charactes. The
config is no plain text file as you assume (only when you stick to english
texts completely). Software which cannot handle 0x1E very likely will
destroy the UTF-8 as well, so I still see no reason to change a good
working solution to a less optimal one.
P.S. For WMS-Links you can create a text-file (local or on a server) which
can be added as a source to the defaults. This is the proper way to pass
these configs. Format is that of http://josm.openstreetmap.de/maps
(described at http://josm.openstreetmap.de/wiki/Maps) or add it at the
maps page in case it is freely usable.
Ciao
--
http://www.dstoecker.eu/ (PGP key available)
More information about the josm-dev
mailing list