Skip to content

JSON fragment files must be UTF8 #339

Closed

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.

Activity

  1. mattwojo commented on Jan 20, 2022

    @mattwojo
    Contributor

    Thanks Ben Stolovitz (@citelao). I'll add this to the JSON fragments doc in a note. It's pretty specific as I'd say most folks will just use VS Code to edit their JSON, but it's good to include a note. Thanks for the contribution! I'll close once I have it added.

  2. added a commit that references this issue on Feb 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

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