Skip to content

Commit

Permalink
Merge pull request #2863 from ControlSystemStudio/CSSTUDIO-2046
Browse files Browse the repository at this point in the history
CSSTUDIO-2046 Bugfixes: decode escaped characters in URIs in two places.
  • Loading branch information
abrahamwolk authored Nov 10, 2023
2 parents 60ed85c + 884f6af commit fae097d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public static DisplayInfo forURI(final URI uri)
// Get basic file or http 'path' from path
final String path;
if (uri.getScheme() == null || uri.getScheme().equals("file"))
path = uri.getRawPath();
path = uri.getPath();
else
{
final StringBuilder buf = new StringBuilder();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

import java.io.File;
import java.net.URI;
import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -166,7 +168,8 @@ public void setInput(final URI input)
name_tab.setTooltip(new Tooltip(Messages.DockNotSaved));
else
{
name_tab.setTooltip(new Tooltip(input.toString()));
String decodedInputURI = URLDecoder.decode(input.toString(), StandardCharsets.UTF_8);
name_tab.setTooltip(new Tooltip(decodedInputURI));
setLabel(name);
}
});
Expand Down

0 comments on commit fae097d

Please sign in to comment.