Page 1 of 1

MyDump produces UTF16 files.

Posted: Fri 24 May 2019 09:41
by ereimers
Hi,

I am using the following code to produce a dump of a database:

MyDump.Connection.Close;
MyDump.Connection.Options.UseUnicode := False;
MyDump.Connection.Options.Charset := 'utf8';
MyDump.Connection.Open;
MyDump.BackupToFile('C:\test\test.dump');

Unfortunately the resulting file is stored in UTF16 coding. This is not readable by the MySQL workbench we are using. After rewriting the file to UTF8 all is fine.
Why does this happen on some Systems, although we are saying to use UTF8 ?

We are using Delphi 10.1.2 (Berlin) and MyDac 8.7.23

Regards
Erik

Re: MyDump produces UTF16 files.

Posted: Mon 27 May 2019 09:30
by ViktorV
In your case, the file will be created with UTF-8 BOM encoding rather than UTF-16. MySQL Workbench may work incorrectly with UTF-8 BOM encoding, e.g. there's a known bug (https://bugs.mysql.com/bug.php?id=95415). To solve your issue, you can convert the resulting file to UTF-8 without BOM encoding.

Re: MyDump produces UTF16 files.

Posted: Thu 06 Jun 2019 05:15
by ereimers
Hi Viktor,

I checked the output files and I am very sure that these are UTF16 !
I could send you an extract of the first bytes of an dump file.

How can I convert the files ?
Using an external App ?

Regards
Erik

Re: MyDump produces UTF16 files.

Posted: Thu 06 Jun 2019 12:58
by ViktorV
To solve your issue please try to use the following guidelines:
- open your dump file in Notepad ++;
- check encoding using the menu Encoding;
- change the encoding to UTF-8 using the menu Encoding;
- save your dump file;
- try the restore operation again.
If you have any questions after reading our answer - please contact us and we will try to give you a detailed answer in the shortly.

Re: MyDump produces UTF16 files.

Posted: Fri 26 Jul 2019 08:29
by ereimers
Hi Viktor,

yes I know that the files could be converted. But these are really giantly big. Some have several GB. So that our customers can´t convert it themselves.

Menu Encoding in Notepad++ is showing "UCS-2 LE-BOM".
So why is MyDump producing this kind of encoding ?

Regards
Erik

Re: MyDump produces UTF16 files.

Posted: Thu 01 Aug 2019 13:24
by Stellar
Unfortunately, we can't reproduce the issue. To investigate this behavior of MyDAC, please compose a small sample demonstrating the issue and send it to us, including database objects creating scripts.
You can send the sample using the contact form at our site: devart.com/company/contactform.html

Re: MyDump produces UTF16 files.

Posted: Wed 21 Aug 2019 06:46
by ereimers
I can´t send you an example Database. Problem only persists on systems of our customers. Nobody would be willing to export their data to you.
I could send you an extract of a dump showing the problem. The dump itself is 1 GB in size.
All these dumps are big in size. Maybe that´s the problem ?

Regards

Re: MyDump produces UTF16 files.

Posted: Thu 22 Aug 2019 14:55
by ViktorV
Please place it on free filehosting and send us the link using the contact form https://www.devart.com/company/contactform.html