Otherwise, the webBrowserComponent’ll not load it and display nothing.
This issue only happens on OSX (10.12).
I used 2 static methods which come from Projucer’s source code to solve the problem. These 2 methods are:
writeEscapeChars(). Code example:
webBrowserComponent.goToURL (addEscapeChars (urlString).replace ("\\x", "%"));
Since Projucer is a commercial software, I don’t know whether it’s legal or not to use those 2 methods.
Hope this topic will help someone:)
Yes, I can, Fabian. but
URL::addEscapeChars() will display nothing at all, just like the normal String-url which includes non-ascii chars.
URL::addEscapeChars() 's escape-function is too powerful, even the ‘/’ also be escaped…
Ahhh ok makes sense… I’ll add something.
The functions you’re using aren’t in the projucer, they’re just part of the C++ tokeniser, but I don’t recommend using them for URLs because they’re designed for a totally different purpose and some encodings may differ!
I don’t know, Jules I found those 2 useful methods in line 550/656 of jucer_UTF8Component.h (Projucer/Utility).
There’re exceptions. (again? :D) In my case, no need to play with any URL. I just need webBrowser goto a string (local html-file path) and display it correctly I’m sure it’s a bad design though
I think you must be on a very old version?
OS X: 10.12.2
JUCE: 4.3.0 (git master branch, pull the library yesterday night)
Seems the only thing is too old must be my brain
In any case, I’ve added a fix for this on develop. Should be public very soon…
Oh, yes, my fault I forgot I’ve ‘jumped to definition’…
Those 2 methods in gui_extra module of JUCE library, code_editor/cppCodeTokeniserFunctions.h