Open anlagbr opened 9 months ago
i also had to change the default encoding previously when using bcpandas, would be great if you can pass it as a param
bcpandas
uses format file created just in time. Thus, the flag -C 65001
won't work because the format file takes precedence.
However, you can specify the collation as a param bcpandas.to_sql
and this solves the problem. I specified collation="Modern_Spanish_100_CI_AS_SC_UTF8"
and it solved my encoding problem.
import bcpandas
bcpandas.to_sql(
df,
table.name,
creds,
collation="Modern_Spanish_100_CI_AS_SC_UTF8",
encoding="utf-8"
)
bcpandas
savespd.DataFrame
with default encodingutf-8
and when it's uploaded throughbcp
some Spanish characters are not displayed correctly in the database. (They are correctly displayed in mypd.DataFrame
Right now, I have tried specifying
-C 65001
to thebcp
command by modifying the sourcebcpandas
files. It has not worked. I will post a solution if I find one.Best.