Fault description:
In the past two days, a department has performed survey to investigate some information. due to some special requirements on the final result report, it has to be decided to discard the export to spreadsheet feature provided by Sharepoint survey, use powershell to export the result.
The problem is that the Chinese characters in survey results cannot be properly displayed, and all printed are question marks ..
Solution:
As a matter of fact, the question of encoding is known at first glance. In an environment where English is the default language, the default encoding of powershell is ASCII.
The simplest way is to use powershell ise instead.Which can display non-English characters. When operating SharePoint data, you only need to run the statement in the statement under the statement when the ISE is started, which is much easier than the management console.
Add-pssnapin Microsoft. Sharepoint. powershell |
Another solution is to change encoding to utf8 and run the following statement.
$ Outputencoding = new-object-typename system. Text. utf8encoding |