srishmawi
Posts: 21
Joined: Tue Jul 07, 2009 2:04 pm

Encoding with installed SQL query

I run SQL script with the installer which first creates the database then execute the sql , it contains characters that needs utf8 enconding. The installation finishes fine and the database is created, but these characters does not appear correctly. However, executing the sql using any other tool makes the characters appear correctly.

How to fix it ?

thanks.
CiprianComsa
Posts: 110
Joined: Thu Aug 19, 2010 10:11 am
Contact: Website

Re: Encoding with installed SQL query

Hi,

This behavior may be encountered if you don't have "UTF-8 codepage" option selected. Go to Media page -> Msi tab and check if the "UTF-8 codepage" option is selected.
Note: the SQL Script file needs to be encoded as UTF8 with BOM in order to be used as an Unicode script.

Best regards,
Ciprian
_________________________________________________________________________________________________________________________________________________
Ciprian Comsa
Advanced Installer Team
http://www.advancedinstaller.com/
Ciprian Comsa - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
SZLMCL
Posts: 26
Joined: Mon Nov 16, 2020 2:18 pm

Re: Encoding with installed SQL query

Hi,

I have also an sql script file that contains unicode characters. I set the UTF8 option in Database encoding tab and set my file encoding to UTF8 with BOM, but the installation failed.
20.PNG
20.PNG (31.65 KiB) Viewed 6771 times
22.PNG
22.PNG (33.49 KiB) Viewed 6771 times
The error throws at this line, but I not see any syntax error:
23.PNG
23.PNG (51.19 KiB) Viewed 6771 times
If I copy-paste the script code to SQL Management Studio, the script executes successfully.

Can you help me please, what is the problem?

Thank you!
Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Encoding with installed SQL query

Hi,

I checked the SQL file in Notepad++ and I noticed that the character between the "RETURN" and "FileTableRootPath()" is not actually a space character (please see a diff in the image below).

Can you please remove that character, then add a space character, save the SQL script and test it again?

Best regards,
Eusebiu
Attachments
Missing Space.png
Missing Space.png (2.26 KiB) Viewed 6745 times
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
SZLMCL
Posts: 26
Joined: Mon Nov 16, 2020 2:18 pm

Re: Encoding with installed SQL query

Hello,

Thank you for the suggestion.
I have more than 300 of this white-char in my script. I dont know what was the origin of this char (char code 194+160). After I replace all with space char, the script working well!

For some reason the SQL Management Studio can handle this char, but the external scripts cannot.

Thanks for help!

BR, László
Catalin
Posts: 6585
Joined: Wed Jun 13, 2018 7:49 am

Re: Encoding with installed SQL query

You are always welcome, László!

We are glad everything works as expected now.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”