Page 1 of 1

Script ExecuteStream and UseUnicode?

Posted: Mon 18 May 2015 08:59
by upscene
Hi,

When using ExecuteStream on the script component, what Encoding should the stream use and does it require a "preamble" if UseUnicode on the Connection is set to True?

And what about other character sets?

What Encoding does using the Execute method use when executing the script in the SQL property of the script component?

Example:

Code: Select all

  s := TStringStream.Create(Memo1.Text, TEncoding.UTF8);
  s := TFileStream.Create('C:\Users\Martijn\Documents\Database Workbench 5 Pro\scripttest_utf8.sql', fmOpenRead);
  try
    MyScript1.ExecuteStream(s);
  finally
    s.Free;
  end;
Using the stringstream works, using the file to open a UTF8 encoded file, including "preamble" fails. Using Unicode as the encoding on the string stream fails with: "
Parser: The unknown symbol ' "

Any clue? Using MyDAC 8.5.14 Delphi 2009.

With regards,

Martijn Tonies

Re: Script ExecuteStream and UseUnicode?

Posted: Tue 19 May 2015 09:57
by ViktorV
Thank you for the information. We are investigating this behavior of MyDAC, and we will inform you about the results.

Re: Script ExecuteStream and UseUnicode?

Posted: Tue 26 May 2015 10:26
by upscene
Any news yet?

with regards,

Martijn

Re: Script ExecuteStream and UseUnicode?

Posted: Tue 26 May 2015 14:01
by ViktorV
We continue the problem investigation and we'll inform you as soon as we get any results.

Re: Script ExecuteStream and UseUnicode?

Posted: Mon 08 Jun 2015 07:45
by upscene
Have you been able to reproduce this issue?

Re: Script ExecuteStream and UseUnicode?

Posted: Fri 12 Jun 2015 13:27
by ViktorV
The fix for TMyScript functioning when working with UTF8 files will be included in the next MyDAC build.

Re: Script ExecuteStream and UseUnicode?

Posted: Fri 12 Jun 2015 13:34
by upscene
And other streams, I hope, as long as they have a "preamble" available?

Re: Script ExecuteStream and UseUnicode?

Posted: Mon 15 Jun 2015 14:04
by ViktorV
Are you asking whether any "preamble" will be used on file loading? If yes, then what other "preambles" do you mean?

Re: Script ExecuteStream and UseUnicode?

Posted: Wed 17 Jun 2015 15:08
by upscene
I meant, is the updated version able to use any type of stream and read it properly, as long as the stream contains the "preamble sequence of bytes" that described the type of data is provides in the stream?

I'm asking, cause I noticed differences in using TStringStream and TFileStream.

Re: Script ExecuteStream and UseUnicode?

Posted: Thu 18 Jun 2015 12:14
by ViktorV
Yes, you are right. MyDAC takes preamble into account on script execution from a thread independently on the class type: TFileStream or TStringSream.

Re: Script ExecuteStream and UseUnicode?

Posted: Mon 22 Jun 2015 13:44
by upscene
Any release date set yet?

Re: Script ExecuteStream and UseUnicode?

Posted: Tue 23 Jun 2015 08:30
by ViktorV
The new MyDAC build with a fix for TMyScript functioning when working with UTF8 files are available for download now.

Re: Script ExecuteStream and UseUnicode?

Posted: Tue 23 Jun 2015 08:33
by upscene
Excellent, thank you.