Opened 10 years ago

Last modified 10 years ago

#12499 closed enhancement

Detect and fix names with multiple spaces — at Version 5

Reported by: naoliv Owned by: team
Priority: normal Milestone: 16.02
Component: Core validator Version:
Keywords: space Cc:

Description (last modified by naoliv)

Sometimes I see objects with multiple spaces at the middle of their names.
For example, something like name=Foo␣␣Bar (two spaces between the words)

Could JOSM detect and remove them, please?

Change History (5)

comment:1 by mdk, 10 years ago

Sorry - missunderstanding. You want to replace repeated spaces in a word. This sound useful.

Will this not automatically done by XMLparser?

Last edited 10 years ago by mdk (previous) (diff)

comment:2 by naoliv, 10 years ago

Exactly, repeated and sequential whitespaces (ie, name=A␣␣B␣␣␣C)
And I don't know about XMLparser.

comment:3 by mdk, 10 years ago

And I don't know about XMLparser.

The default behavior of a XML parser is replacing all whitespace sequences (space, tab, cr, ...) by a single space. If you want to preserve multiple whitespaces, you need a CDATA block or some parsers allow a special mode to prevent this behavior.

On upload (and parsing on the server) there is a good chance that this is automatically "correctd".

Are you able to upload a name with multiple sequential whitespaces?

comment:4 by naoliv, 10 years ago

I can't create and upload it, but I see data in OSM with multiple spaces.
If I download one area with objects like this I would like to have them detected and fixed.

Sometimes I am able to indirectly locate them because JOSM detects similar names. For example, name=Street␣A␣B␣C and name=Street␣A␣␣B␣C.

So what I would like to have is similar to what the validator already does when a value starts or ends with a whitespace: it gives a warning and offers to fix it.

Last edited 10 years ago by naoliv (previous) (diff)

comment:5 by naoliv, 10 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.