Skip to content

Decode GitHub CLI JSON as UTF-8 under legacy locales #1505

Done

Description

@eowca

Reproducer

On a68ef3b1, put a fake gh on PATH that returns an HTTP 200 response with a raw UTF-8 JSON body such as {"title":"Zażółć gęślą jaźń"}. Call github._gh_json("api", "repos/acme/widgets/pulls/7") with app auth disabled in the fixture. Start Python with env -u LC_ALL -u LC_CTYPE LANG=C PYTHONUTF8=0 PYTHONCOERCECLOCALE=0. Repeat under an installed ISO-8859-2 locale with Python UTF-8 mode off.

Observed. JSON parsing succeeds, but ASCII replaces accented characters and ISO-8859-2 produces mojibake. The data is already corrupted before the command can use it.

Expected. Loop-zero parses the GitHub response as UTF-8 and returns the original title in either locale.

Acceptance

  • Preserve literal Unicode text and identifiers in offline REST and GraphQL responses under a legacy locale.
  • Preserve existing JSON parsing, retries, and error handling for GitHub responses.
  • Extend an existing fake GitHub case with zero net new test lines.

Activity

  1. eowca commented on Nov 26, 2026

    @eowca
    ContributorAuthor

    Parked: #1529 has the corrected head and its blocking finding is resolved, but earlier base merges prevent the delta review the CLI requires (#1240, fix in #1259). Resumes when #1259 merges; no replacement PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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