BadDataException

I have been having extensive issues with my web app both CGI and Standalone. After fighting with the app deployed on Linux (Ubuntu 14.04 LTS), I built it for my Mac to see if I could get some sort of console output. I am now receiving several ": BadDataExecption errors and the app locks up.

I have tried (based on other forum posts)

...rs.Field("id").StringValue.DefineEncoding(Encodings.ASCII).ToText

and

...rs.Field("id").StringValue.DefineEncoding(Encodings.UTF8).ToText

on all RecordSet .StringValue statements with no luck. I am also issuing db.SQLExecute("SET NAMES 'utf-8'") on every connect to the MySQL DB.

Any help with this show stopper is greatly appreciated.

[code]Feb 25 05:15:08 Tally[12425] : BadDataException

rbframework.dylib$2110
String_ToText
String.$ToText%y%s
_WebSupport.Split%A1s%ss
WebSource.Append%%o<WebSource>si8b
WebLabel.Event_RenderHTML%o<WebSource>%o<WebLabel>
WebControl.Event_RenderHTML%o<WebSource>%o<WebControl>
WebObject._Render%o<WebSource>%o<WebObject>i8
WebContainer.Event_RenderHTML%o<WebSource>%o<WebContainer>
WebView.Event_RenderHTML%o<WebSource>%o<WebView>
WebControl.Event_RenderHTML%o<WebSource>%o<WebControl>
WebObject._Render%o<WebSource>%o<WebObject>i8
WebView._RenderOneChild%%o<WebView>o<WebControl>o<WebResponse>
WebView._RenderNewChildren%%o<WebView>o<WebResponse>
WebView._RenderNewChildren%%o<WebView>o<WebResponse>
WebView._RenderNewChildren%%o<WebView>o<WebResponse>
WebView._RenderNewChildren%%o<WebView>o<WebResponse>
WebSession._CreateResponse%o<WebResponse>%o<WebSession>
WebSession._HandleEvent%%o<WebSession>so<_HTTPServer.HTTPRequestContext>
WebSession._HandleRequest%i8%o<WebSession>so<_HTTPServer.HTTPRequestContext>
WebApplication._HandleHTTPRequest%%o<WebApplication>o<_HTTPServer.HTTPRequestContext>
_HTTPServer.HTTPRequestThread.Event_Run%%o<_HTTPServer.HTTPRequestThread>
rbframework.dylib$1192
_pthread_body

[/code]

Output from the App.UnhandledException event is

"String must have a known encoding
rbframework.dylib$2110
String_ToText
String.$ToText%y%s
_WebSupport.Split%A1s%ss
WebSource.Append%%osi8b
WebLabel.Event_RenderHTML%o%o
WebControl.Event_RenderHTML%o%o
WebObject._Render%o%oi8
WebContainer.Event_RenderHTML%o%o
WebView.Event_RenderHTML%o%o
WebControl.Event_RenderHTML%o%o
WebObject._Render%o%oi8
WebView._RenderOneChild%%ooo
WebView._RenderNewChildren%%oo
WebView._RenderNewChildren%%oo
WebView._RenderNewChildren%%oo
WebView._RenderNewChildren%%oo
WebSession._CreateResponse%o%o
WebSession._HandleEvent%%oso<_HTTPServer.HTTPRequestContext>
WebSession._HandleRequest%i8%oso<_HTTPServer.HTTPRequestContext>
WebApplication._HandleHTTPRequest%%oo<_HTTPServer.HTTPRequestContext>
_HTTPServer.HTTPRequestThread.Event_Run%%o<_HTTPServer.HTTPRequestThread>
rbframework.dylib$1192
_pthread_body
"

I’d temporarily replace all

... = rs.Field("id").StringValue.DefineEncoding(Encodings.UTF8).ToText

with

... = "abc"

Then you would now it it is related to that or not. String literals in Xojo always have an UTF8 encoding.

Replacing all .StringValue statements with DefineEncoding(rs.Field("account_name").StringValue,Encodings.UTF8) seems to have fixed the BadDataExceptions but the CGI built application is still running super dog slow.