Last revision could not handle URL encoding such as %20.
authortoshihiro <toshihiro>
Sun, 29 Jul 2007 12:13:51 +0000 (12:13 +0000)
committertoshihiro <toshihiro>
Sun, 29 Jul 2007 12:13:51 +0000 (12:13 +0000)
net.sourceforge.phpeclipse.webbrowser/src/net/sourceforge/phpeclipse/webbrowser/views/BrowserView.java

index 52f6ab4..852b24d 100644 (file)
  *******************************************************************************/
 package net.sourceforge.phpeclipse.webbrowser.views;
 
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.nio.charset.Charset;
+
 import net.sourceforge.phpeclipse.webbrowser.internal.WebBrowser;
 import net.sourceforge.phpeclipse.webbrowser.internal.WebBrowserUtil;
 
@@ -124,8 +128,16 @@ public class BrowserView extends ViewPart implements IShowInTarget {
                                setUrl(url);
                        } else {
                                Browser browser = fInstance.getBrowser();
-                               if (browser != null && !browser.getUrl().equals(url)) {
-                                       setUrl(url);
+                               if (browser != null) {
+                                       String browserUrl = browser.getUrl();
+                                       try {
+                                               browserUrl = URLDecoder.decode(browserUrl, Charset.defaultCharset().name());
+                                       } catch (UnsupportedEncodingException e) {
+                                               // e.printStackTrace();
+                                       }
+                                       if (!url.equals(browserUrl)) {
+                                               setUrl(url);
+                                       }
                                }
                        }
                }