Opened 4 years ago

Last modified 14 months ago

#21597 new defect

Zero-width space when copy/pasting URL from Notes — at Version 2

Reported by: mnalis Owned by: team
Priority: normal Milestone:
Component: Core notes Version: tested
Keywords: template_report Cc:

Description (last modified by mnalis)

What steps will reproduce the problem?

  1. click on the Note containing URL (eg. Note 286025)
  2. select URL in JOSM Note window, and press ctrl-C to copy it
  3. paste URL in web browser (firefox) URL bar with ctrl-v

What is the expected result?

I would expect URL I see on screen in JOSM (eg. "https://westnordost.de/​p/61107.jpg") to be pasted

What happens instead?

URL containing invalid/nonexistent character is pasted, eg. "https://westnordost.de/%E2%80%8Bp/61107.jpg"

Please provide any additional information below. Attach a screenshot if possible.

When I click on the note (for example Note 286025) window with its description appears. It contains clickable URL (which I sometimes cannot click, due to other bug coming soon). URL looks normal visually for example "https://westnordost.de/​p/61107.jpg", however, when it is pasted in browser window it becomes this:
https://westnordost.de/%E2%80%8Bp/61107.jpg which is wrong and doesn't work.

Looking around (https://stackoverflow.com/a/63187080/2600099), it seems that "E2 80 8B" is UTF-8 "zero-width space", which incorrectly gets inserted somehow.

Looking at the original Note in Notes dump, it looks the note is correctly stored in OSM database, so it is likely that something that JOSM does which causes the corruption:

% curl -sL https://planet.openstreetmap.org/notes/planet-notes-latest.osn.bz2 | bzip2 -dc | env -i LC_ALL=C fgrep https://westnordost.de/ | fgrep /61107.jpg | hd
00000000  68 74 74 70 73 3a 2f 2f  77 65 73 74 6e 6f 72 64  |https://westnord|
00000010  6f 73 74 2e 64 65 2f 70  2f 36 31 31 30 37 2e 6a  |ost.de/p/61107.j|
00000020  70 67 3c 2f 63 6f 6d 6d  65 6e 74 3e 0a           |pg</comment>.|
0000002d

Possibly related: https://josm.openstreetmap.de/ticket/19616

Original issue reported at: https://github.com/streetcomplete/StreetComplete/issues/3439

Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2021-11-01 23:05:46 +0100 (Mon, 01 Nov 2021)
Revision:18303
Build-Date:2021-11-01 22:25:18
URL:https://josm.openstreetmap.de/svn/trunk

Identification: JOSM/1.5 (18303 en) Linux Debian GNU/Linux 11 (bullseye)
Memory Usage: 612 MB / 1456 MB (118 MB allocated, but free)
Java version: 11.0.13+8-post-Debian-1deb11u1, Debian, OpenJDK 64-Bit Server VM
Look and Feel: javax.swing.plaf.metal.MetalLookAndFeel
Screen: :0.0 1920×1080 (scaling 1.00×1.00)
Maximum Screen Size: 1920×1080
Best cursor sizes: 16×16→16×16, 32×32→32×32
Environment variable LANG: C.UTF-8
System property file.encoding: UTF-8
System property sun.jnu.encoding: UTF-8
Locale info: en
Numbers with default locale: 1234567890 -> 1234567890
Desktop environment: ICEWM
Java package: openjdk-11-jre:amd64-11.0.13+8-1~deb11u1
WebStart package: icedtea-netx:all-1.8.4-1
libcommons-compress-java: libcommons-compress-java:all-1.20-1
fonts-noto: fonts-noto:all-20201225-1
liboauth-signpost-java: liboauth-signpost-java:all-1.2.1.2-3
VM arguments: [--patch-module=java.desktop=/usr/share/icedtea-web/javaws.jar:, --add-reads=java.base=ALL-UNNAMED,java.desktop, --add-reads=java.desktop=ALL-UNNAMED,java.naming, --add-reads=java.naming=ALL-UNNAMED,java.desktop, --add-exports=java.desktop/sun.awt=ALL-UNNAMED,java.desktop, --add-exports=java.desktop/javax.jnlp=ALL-UNNAMED,java.desktop, --add-exports=java.base/com.sun.net.ssl.internal.ssl=ALL-UNNAMED,java.desktop, --add-exports=java.base/sun.net.www.protocol.jar=ALL-UNNAMED,java.desktop, --add-exports=java.base/sun.security.action=ALL-UNNAMED,java.desktop, --add-exports=java.base/sun.security.provider=ALL-UNNAMED,java.desktop, --add-exports=java.base/sun.security.util=ALL-UNNAMED,java.desktop, --add-exports=java.base/sun.security.validator=ALL-UNNAMED,java.desktop, --add-exports=java.base/sun.security.x509=ALL-UNNAMED,java.desktop, --add-exports=java.base/jdk.internal.util.jar=ALL-UNNAMED,java.desktop, --add-exports=java.base/sun.net.www.protocol.http=ALL-UNNAMED,java.desktop, --add-exports=java.desktop/sun.awt.X11=ALL-UNNAMED,java.desktop, --add-exports=java.desktop/sun.applet=ALL-UNNAMED,java.desktop, --add-exports=java.desktop/sun.applet=ALL-UNNAMED,jdk.jsobject, --add-exports=java.naming/com.sun.jndi.toolkit.url=ALL-UNNAMED,java.desktop, -Dicedtea-web.bin.name=javaws, -Dicedtea-web.bin.location=/usr/share/icedtea-web/bin/javaws.sh, -Djava.security.manager, -Djava.security.policy=/etc/icedtea-web/javaws.policy]
Dataset consistency test: No problems found

Plugins:
+ DirectUpload (35858)
+ apache-commons (35524)
+ buildings_tools (35823)
+ conflation (0.6.8)
+ ext_tools (35640)
+ imagery_offset_db (35640)
+ jts (35458)
+ pt_assistant (1ff2e15)
+ reverter (35846)
+ turnrestrictions (35640)
+ utilsplugin2 (35856)

Tagging presets:
+ https://<user.name>.com/prezentacije/OpenStreetMap/josm-preset.xml
+ https://raw.githubusercontent.com/OpenNauticalChart/josm/master/INT-1-preset.xml

Map paint styles:
- https://josm.openstreetmap.de/josmfile?page=Styles/PublicTransport&zip=1
+ http://bezdomni.net/Styles_HighlightedCapesBays-style.mapcss
+ https://josm.openstreetmap.de/josmfile?page=Styles/ColorWays&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Coloured_Streets&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Fixme&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Modified&zip=1

Validator rules:
+ https://josm.openstreetmap.de/josmfile?page=Rules/KeepRight&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Rules/QAToolInspiredValidations&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Rules/OSMLint&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Rules/MissingWeekdays&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Rules/SourceObjectTag&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Rules/IndoorRules&zip=1

Last errors/warnings:

- 05014.973 E: java.nio.file.AccessDeniedException: ${HOME}/tmp/g/1/prvic_20210913.osm~
- 05023.425 E: java.nio.file.AccessDeniedException: ${HOME}/tmp/g/1/prvic_20210913.osm~

Change History (2)

comment:1 by skyper, 4 years ago

See also #21593.

comment:2 by mnalis, 4 years ago

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