I use MariaDB on Docker for Windows with the Powershell. When I want to create a mysqldump with docker exec and redirect the file from container to hostsystem, the encoding changes from UTF8 to UTF16.
This is my command to create mysqldump:
docker exec -i containername mysqldump -uusername -ppassword database > .\sql-filename.sql
And cause of this ">" the file will be encoded in UTF16.
The problem is the usage of Powershell 5.1. With the installation of Windows Terminal and Powershell (7+) via the Microsoft Store it is possible to change the encoding. Important is to use the pwsh.exe and not powershell.exe. After installation the following settings must be done. So the link of Pino is great.