Reputation: 9426
I have the following code:
var Date: TDate := now;
var Time: TTime := now;
...
var Text: string := trim(DateToStr(Date)) + '|' + trim(TimeToStr(Time));
UniQuery1.FieldByName('BATCH DATA').AsString := Text;
After this code, the Text
variable still contains 9/6/24|8:14:15 AM
as you would expect.
However, UniQuery1.FieldByName('BATCH DATA').AsString
contains 9/6/24|8:14:15?AM
.
In other words, assigning the value to a TUniQuery field swapped the space for a ?.
The database it is connected to is a SQLite database that is UTF-8 encoded. I'm using Delphi 11.3 Alexandria.
I'm assuming this has something to do with character encoding, but I have no idea why a space would be encoded differently or how to see or change the character encoding of the string that comes from TimeToStr()
.
The really odd thing is this doesn't happen on 32bit or 64bit Windows or our 32bit Samsung Tab Active 2 Android tablets. It copies the Text
variable with the original spaces. However, we just upgraded to Samsung Tab Active 5 Tablets which are 64bit tablets and that's when the behavior changed.
Please help! I have been beating my head against this for days! What can I do to try to resolve this?
Upvotes: 0
Views: 43