Pass unicode text in do shell script mySQL command

Hello scripters!
I have problem with feeding MySQL table via do shell script command. The problem is only with polish diacritic characters.

the command is:

do shell script "/Applications/MAMP/Library/bin/mysql --host=localhost -uroot -proot -D nanc_pusta01 -e \"" & "insert into articlesTable values(1224420, '2020-11-16 00:00:01', 'ĄĘŚĆŃŻŹŁ', 1, 'Zażólcić gęślą jaźń', 1632, 14, NULL, NULL, NULL, 0, '', '', 0, 0)\""

this command (grabbed in text form from ScriptDebugger Variables pane) pasted to terminal via clipboard gives the right result. Encoding is OK.

But, using do shell script, they gives wrong encoded character. Totally wrong. Collation on database table is set to UTF8.

I use ScriptDebugger v. 6.04

I don’t see any variable in your example.

The fact that everything works correctly through the clipboard does not mean that the encoding is correct. The clipboard complements several other formats to the input format (reserves all possible cases).

Your collation on database table is set to UTF8, and you try pass the Unicode text (UTF16).

I checked: do shell script works with UTF16 representation fine. So, the problem is the indicated above.
You should convert polish diacritic texts to UTF8, and only then pass them to your database:

set var1 to "ĄĘŚĆŃŻŹŁ" as «class utf8»
set var2 to "Zażólcić gęślą jaźń" as «class utf8»

do shell script "/Applications/MAMP/Library/bin/mysql " & ¬
	"--host=localhost -uroot -proot -D nanc_pusta01 -e \"" & ¬
	"insert into articlesTable values(1224420, '2020-11-16 00:00:01', " & quoted form of var1 & ¬
	", 1, " & quoted form of var2 & ", 1632, 14, NULL, NULL, NULL, 0, '', '', 0, 0)\""