Skip to content

JSON fragment files must be UTF8 #339

@citelao

Description

@citelao

I was experimenting with JSON fragment files for creating profiles automatically, and I noticed that my new profiles weren't appearing in Terminal.

After some investigation, it turned out that Terminal will only read files formatted with UTF8, not UTF16LE (which PowerShell uses by default).

So if you are generating fragments via PowerShell, you must use -Encoding Utf8:

# BAD: Uses UTF16LE
Write-Output $fragmentJson > $fragmentPath

# GOOD: Uses UTF8, so Terminal will read this
Write-Output $fragmentJson | Out-File $fragmentPath -Encoding Utf8

If this is by design, we should document this requirement. Thanks!


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions