我目前正在从PowerShell脚本生成JSON文件,但它正在输出Unicode而不是特殊字符,如'
这是我得到的输出:
[
{
"Id": "187303",
"LinkText": "\u003cb style =color:#d11717;\u0027\u003eAnnual General Meeting (MEET)"
},
{
"Id": "187305",
"LinkText": "\u003cb style =color:#d11717;\u0027\u003eAnnual General Meeting (MEET)"
}
]
这是我使用的代码:
$(foreach ($row in $DataSet.Tables[0].Rows){
$stockShortName = $row[0].ToString().Trim()
$id = $row[0].ToString().Trim()
$linkText = "$event_description"
(New-Object PSObject |
Add-Member -PassThru NoteProperty Id $id |
Add-Member -PassThru NoteProperty LinkText $linkText
)
}) | ConvertTo-JSON | Out-File $OutputFile -Encoding "default"
2013-03-22
steven
+0
-encoding UTF8? –
2013-03-22 19:06:43