我正在尝试将SQL Server数据库导出为CSV文件。为此,我使用的是PowerShell脚本。
如您所见,在数据库中我有一些特殊字符(丹麦语)。
但是在导出的文件中,这些字符被替换为?如下所示:
有关信息,在我的powershell脚本中,这是导出文件的行:
$ DataSet.Tables [0] | Export-Csv $ extractFile -NoTypeInformation -Encoding“ISO-8859-15”
有人可以帮忙吗?谢谢!
编辑:
@JamesQMurphy这里是代码
答案 0 :(得分:1)
经过测试,我的正确编码是BigEndianUnicode
将您的编码更改为:
$DataSet.Tables[0] | Export-Csv $extractFile -NoTypeInformation -Encoding BigEndianUnicode