pharo icon indicating copy to clipboard operation
pharo copied to clipboard

WebBrowser openOn: 'http://pharo.org/' fails on Win10&11, Pharo10,11&12

Open ironirc opened this issue 2 years ago • 4 comments

I noticed there's a problem with opening a webbrowser (tested on Win10&11, Pharo10,11&12, 2 separate machines) WebBrowser openOn: 'http://pharo.org/' The string doesn't get properly encoded (or something), resulting in the browser opening on the url, with some random characters added (e.g. "http://pharo.xn--org-kha/").

Changing following method by adding utf8Encoded fixes the problem:

openNativeWebBrowserOn: anURLString
  ^self shellExecute: 'open' file: (anURLString utf8Encoded)  parameters: '' directory: '' show: 5

ironirc avatar Jul 16 '23 14:07 ironirc

Mmmh ... strange

WebBrowser openOn: 'http://pharo.org/'

works like a charm for me.

astares avatar Jul 17 '23 09:07 astares

Sure you have latest VM?

astares avatar Jul 17 '23 10:07 astares

WebBrowser openOn: 'http://pharo.org/' also works for me. BUT WebBrowser openOn: 'http://pharo.org' fails?

Alternatively, click the play button on: WebBrowser class>>#example

Now I'm wondering why I put a trailing slash from in the title.

Now I also need a different patch (which might make more sense):

openNativeWebBrowserOn: anURLString
  ^self shellExecute: 'open' file: (anURLString nullTerminatedEncodeWith: #utf8)  parameters: '' directory: '' show: 5

ironirc avatar Jul 18 '23 21:07 ironirc

@ironirc Can you check again please in Pharo 12. I think this was fixed and we can close.

astares avatar May 29 '24 09:05 astares

Just checked again on Pharo 12 with a doit on: WebBrowser openOn: 'http://pharo.org/'

ironirc avatar Jul 02 '24 06:07 ironirc