PowerShell配置文件的正确(首选)编码是什么?

问题描述 投票:1回答:1

我在Internet上四处张望,找不到相关信息。我的程序需要向PowerShell配置文件中编写一些PowerShell代码。如果没有配置文件,我的程序将创建一个。问题是应使用哪种编码来创建PowerShell配置文件。我应该使用UTF8吗?还是带有BOM的UTF8?

powershell encoding profile
1个回答
0
投票

技术上,PowerShell配置文件使用以下编码(来自我自己的配置文件。)>

BodyName          : iso-8859-1
EncodingName      : Western European (Windows)
HeaderName        : Windows-1252
WebName           : Windows-1252

而带有UTF-8的文件将如下所示。

BodyName          : utf-8
EncodingName      : Unicode (UTF-8)
HeaderName        : utf-8
WebName           : utf-8

ASCII,ISO-8859-1和UTF-8之间的区别:

ASCII: 7 bits. 128 code points.
ISO-8859-1: 8 bits. 256 code points.
UTF-8: 8-32 bits. 1,112,064 code points.

先前已经在What is the difference between UTF-8 and ISO-8859-1?

]上进行了讨论。
© www.soinside.com 2019 - 2024. All rights reserved.