testcontainers-dotnet icon indicating copy to clipboard operation
testcontainers-dotnet copied to clipboard

[Enhancement]: Overload ExecScriptAsync with encoding as a parameter

Open macoutlook opened this issue 1 year ago • 2 comments

Problem

Script content contains UTF-8 characters which are not saved properly to MySql db during db initialisation and script execution.

Solution

Giving possibility to define particular encoding as parameter.

Benefit

Extending possibility to handle non-standard characters among different cultures.

Alternatives

Changing Encoding.Default which is not recommended by MS to UTF8

Would you like to help contributing this enhancement?

Yes

macoutlook avatar Jun 18 '24 07:06 macoutlook

Yes, this is something we should support. We just need to ensure that we pass the encoding argument down all the way to ensure it is used everywhere.

HofmeisterAn avatar Jun 18 '24 15:06 HofmeisterAn

I second this.

I spent a lot of time debugging why my database creation script via ExecScriptAsync was creating tables without default values on the mssql container. Turns out with the test project using the .net Framework 4.8 my script was turned into codepage garbage all along.

multiguy18 avatar Sep 26 '25 15:09 multiguy18