Skip to content

Commit

Permalink
URLEncoder.encode() compatibility issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
mpyat2 committed Nov 5, 2023
1 parent 3b80cdc commit 517abf6
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Set;
Expand All @@ -42,7 +42,6 @@
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.ListCellRenderer;
import javax.swing.ListSelectionModel;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
Expand Down Expand Up @@ -478,7 +477,12 @@ public void actionPerformed(ActionEvent e) {
String description = (String)(pluginListModel.get(index));
String plugin_doc_name = manager.getPluginDocName(description);
if (plugin_doc_name != null) {
urlStr += URLEncoder.encode(plugin_doc_name, StandardCharsets.UTF_8).replace("+", "%20");
try {
plugin_doc_name = URLEncoder.encode(plugin_doc_name, "UTF-8");
} catch (UnsupportedEncodingException ex) {
plugin_doc_name = "";
}
urlStr += plugin_doc_name.replace("+", "%20");
}
}
Mediator.openHelpURLInWebBrowser(urlStr);
Expand Down

0 comments on commit 517abf6

Please sign in to comment.