I have a small project that shows a webpage using mywebpage.show in a button.
works fine in 2020r21, and seems to hang (or quit without really quitting) in 2021r1
this page has some websdkuicontrols on it
seems to have to do with my websdkuicontrols. if there are any on the webpage, it hangs into the debugger and you are nowhere. tried to do an autotab but it is the same.
if I remove all the websdkuicontrols, the webpage is shown correctly.
I tried with the last beta and it is still there.
I’m afraid that in some circumstances people mess with the DOM and events in a such way they can confuse the Xojo engine and their tracking of states and logic when Xojo changes something. Maybe you touched some of those places…
Another big change I can think of is that we changed the engine behind the scenes of JSONItem and it’s much more particular about encodings than it was before.
In your routine where you are splitting apparent the initial value, you are using &h09 for a tab character. One problem I see is that this character has an ASCII encoding and just concatenating this with a UTF8 string means that you end up with a mixed encoding string. JSON requires UTF8.
FYI, it would have saved me a lot of time if you had mentioned that it also does not fail if the initial value isn’t set at all. That narrows down the scope of where the problem could be by at least 90%.
Yeah it’s the structure. Structure elements, even if they are strings, don’t have encoding information associated with them.
I suggest you make an extension method for ensuring the encoding of a string that looks something like this:
Public Function ToUTF8(extends s as string) As String
If s.Encoding = Nil Then
Return s.DefineEncoding(Encodings.UTF8)
End If
If s.Encoding = encodings.UTF8 Then
Return s
End If
Return s.ConvertEncoding(encodings.UTF8)
End Function
and then add that in each place where you are pulling data from that structure… like this:
will try to narrow that.
but in the example project I provided in the feedback, there are simple “line1” “line2” … values in the initialvalue property, there is no tab. and it still doesn’t show anything and hang in the debugger.
I’ll look into that. It’s a strange thing because it’s not really in a place where we can throw an UnhandledException in the session, but we can probably throw it at the application level.
Unfortunately it’s in internal code that the debugger can’t show to you, so at the moment the debugger is doing the best that it can.