Skip to content

Fix encoding error when database encoding is ASCII - #1629

Draft
dbaty wants to merge 2 commits into
mainfrom
dbaty/fix_encoding_error
Draft

Fix encoding error when database encoding is ASCII#1629
dbaty wants to merge 2 commits into
mainfrom
dbaty/fix_encoding_error

Conversation

@dbaty

@dbaty dbaty commented Sep 4, 2026

Copy link
Copy Markdown
Member

Description

Tentative fix of encoding issues (#1405, #1518) by forcing the encoding to utf-8 (to receive strings), even when the database encoding is ASCII (which would return bytes and make pgcli raise exceptions in several places).

I've tried that weeks or months ago (based on this great comment that pinpointed the cause of these long-standing issues). I think I manually tested and verified most of the changes (if not all), but automated tests are lacking. This is just a draft to show a different way of fixing the issue (instead of forcefully and blindly converting bytes to a string, as in #1628).

Checklist

  • I've added this contribution to the changelog.rst.
  • I've added my name to the AUTHORS file (or it's already there).
  • I installed pre-commit hooks (pip install pre-commit && pre-commit install).
  • I verified that my changes work as expected (this may include manually testing them in your local environment, or in other available environments). Cross this out if not relevant (for example, if you're making a documentation change).
  • Please squash merge this pull request (uncheck if you'd like us to merge as multiple commits)

@dbaty dbaty changed the title Dbaty/fix encoding error Fix encoding error when database encoding is ASCII Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant