pharo
pharo copied to clipboard
WebBrowser openOn: 'http://pharo.org/' fails on Win10&11, Pharo10,11&12
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
Mmmh ... strange
WebBrowser openOn: 'http://pharo.org/'
works like a charm for me.
Sure you have latest VM?
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 Can you check again please in Pharo 12. I think this was fixed and we can close.
Just checked again on Pharo 12 with a doit on: WebBrowser openOn: 'http://pharo.org/'