I am using a database to store and retrieve text for a text area.
In using the latest version of Xojo.
in he text area. Instead of carriage returns, I’m getting question marks inside black diamonds in one line of text.
I;ve tried storing the text with replaceall(t,endofline,"") and then when the text comes in, I'd do replaceall(t,"",endofline).
I still get the same problem - it seems that text area is having a problem with chr(13) or endofline
Nota: there is a Database Channel (instead of general) and you do not specify the used Data Base name.[/quote]
Thats not right. This is an Encoding issue.
Whenever you pull data from an outside source, you must tell your app what the encoding is. Something like:
[quote=351978:@Sean Clancy]I am using a database to store and retrieve text for a text area.
In using the latest version of Xojo.
in he text area. Instead of carriage returns, I’m getting question marks inside black diamonds in one line of text.[/quote]
So when you pull Data from the RecordSet you should do something like:
TextArea.Text = RecordSet.Field("theTextField").StringValue.DefineEnconding(Encodings.WindowsLatin1) // Use the Database's Encoding.
And when you push Data:
PreparedStatement.Bind(0, theTextArea.Text.ConvertEncoding(Encodings.WindowsLatin1), mySQLPreparedStatement.SQLTYPE_STRING) // // Use the Database's Encoding again.
Because you are working with UTF8 Encoded Displays and nev to Encode/Decode the Data for the Database, using the Database’s Encoding. So, both Ends using their correct Enconding. UTF8 for your Screen and the Database’s Encoding for … the Database.
BTW: Code written from my mind without using Xojo IDE. Real Code may varry.
And if the diamond character is not explained in the other thread:
when a font does not have a character, the OS display the replacement character: the diamond character