Can a uri-encoded character in a href be escaped?
Posted: Tue Mar 07, 2023 7:00 pm
Hi,
I have a mapref with a filename containing "%2A" (which is the URI-encoded form of "*").
When opening the map containing this mapref in Oxygen, an error is given:
Oxygen is decoding the filename before going to the filesystem, which I don't want in this case, because on the filesystem it is in the encoded form.
Note that I also have XSLT scripts using this file, run in Saxon, and they show similar behaviour, so it seems to be default behaviour for interpreting XML to decode URI-encoded characters.
There is a workaround that seems to work in Oxygen, to double encode the character: so "%2A" becomes "%252A".
I suppose that this is the way it should be done. Just posting this (1) for anyone who has the same issue and (2) for confirmation that there's indeed no better solution, that would allow me to have the "real" filename in the href attribute in the XML file.
Best regards,
Vic
I have a mapref with a filename containing "%2A" (which is the URI-encoded form of "*").
Code: Select all
<mapref format="ditamap"
href="../published/en-us/axk1438118744716.ditamap_20180406+1005+%2A/axk1438118744716_202301300844_008.ditamap"
class="+ map/topicref mapgroup-d/mapref "/>
Code: Select all
File not found: "D:\mcmsm\published\en-us\axk1438118744716.ditamap_20180406+1005+*\axk1438118744716_202301300844_008.ditamap".
Note that I also have XSLT scripts using this file, run in Saxon, and they show similar behaviour, so it seems to be default behaviour for interpreting XML to decode URI-encoded characters.
There is a workaround that seems to work in Oxygen, to double encode the character: so "%2A" becomes "%252A".
I suppose that this is the way it should be done. Just posting this (1) for anyone who has the same issue and (2) for confirmation that there's indeed no better solution, that would allow me to have the "real" filename in the href attribute in the XML file.
Best regards,
Vic