[英]while exporting data from SQL Server using Export-Csv (PowerShell) command double quotes are converted into question mark (?)
Here is my Table having column "Value"-这是我的表格,其中包含“值”列-
Value![]() |
---|
This "data").![]() ![]() |
("Party A") and ("Party B") ![]() |
Invoke-Sqlcmd -ServerInstance 'SQLSERVER' -Database "SQL" -Query "select * from Table" | Export-Csv -Path "C:\Users\Desktop\Outquery.csv" -NoTypeInformation
this code works fine but while exporting the data into CSV file doublequotes are converted into unexpected value with question mark (?)此代码工作正常,但在将数据导出到 CSV 文件时,双引号被转换为带有问号 (?) 的意外值
CSV OUTPUT:- CSV OUTPUT:-
VALUE
-------
This ?data?). has consists of ?information?
(?Party A?) and (?Party B?)
After further research adding "-Encoding UTF8" at the end of the code it is now exporting as expected.经过进一步研究,在代码末尾添加“-Encoding UTF8”后,它现在可以按预期导出。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.