CarloM 3 Posted April 11, 2019 Hello, When I use a OpenDialog.Filename on Mac OS and stores value in a SQlite varchar(255) column no english chars like í, ó,... are converted to ? character. Example: "Sin título.jpg" is converted to "Sin t?tulo.jpg" when stores to database. If I invoke a showMessage(OpenDialog.Filename) it is ok. but when I save: DS.Edit; DS.FieldByName('Nombre').AsString := ExtractFileName(OpenDialog.Filename); DS.Post; or if Assign to a AnsiString var then problem is the same Regards Share this post Link to post
Remy Lebeau 1394 Posted April 12, 2019 On 4/11/2019 at 3:53 AM, CarloM said: When I use a OpenDialog.Filename on Mac OS and stores value in a SQlite varchar(255) column no english chars like í, ó,... are converted to ? character. As they should be. On 4/11/2019 at 3:53 AM, CarloM said: Example: "Sin título.jpg" is converted to "Sin t?tulo.jpg" when stores to database. If I invoke a showMessage(OpenDialog.Filename) it is ok. Makes sense, since you are saving to an ANSI database field, so you are invoking a lossy Unicode->ANSI conversion. On 4/11/2019 at 3:53 AM, CarloM said: but when I save: DS.Edit; DS.FieldByName('Nombre').AsString := ExtractFileName(OpenDialog.Filename); DS.Post; or if Assign to a AnsiString var then problem is the same Because you are still invoking a conversion to ANSI. Have you tried switching the database column to nvarchar, and using TField.AsWideString? 1 Share this post Link to post
CarloM 3 Posted April 15, 2019 Hi Remy, I am use a SQLite database in UTF8 mode, I think that all was saved in UT8. on Windows works well Share this post Link to post
Guest Posted April 15, 2019 59 minutes ago, CarloM said: Hi Remy, I am use a SQLite database in UTF8 mode, I think that all was saved in UT8. on Windows works well Are you using FireDAC? Then show us the connection settings Share this post Link to post