Skip to content

Added recode.pl to fix Bug 2000203#150

Merged
justdave merged 4 commits into
bugzilla:mainfrom
MartijnRas:main
Jun 5, 2026
Merged

Added recode.pl to fix Bug 2000203#150
justdave merged 4 commits into
bugzilla:mainfrom
MartijnRas:main

Conversation

@MartijnRas

@MartijnRas MartijnRas commented Nov 16, 2025

Copy link
Copy Markdown
Contributor

Details

This PR fixes/adds a feature...

Additional info

NOTE: Bug number is required. If you haven't filed a bug on https://bugzilla.mozilla.org/enter_bug.cgi?product=Bugzilla yet, don't submit the Pull Request. Please edit the above link to put the bug number both immediately after the # character and after the = character at the end. You can delete this paragraph once you've added your bug number.

Test Plan

  1. Open the show_bug view
  2. Edit the bug
  3. ...

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new contrib/recode.pl command-line utility intended to recode Bugzilla database text columns into UTF-8 (optionally guessing per-row encodings) to address Bug 2000203.

Changes:

  • Introduces contrib/recode.pl to scan DB tables/columns and update non-UTF-8 text rows to UTF-8.
  • Supports --guess, --charset, --dry-run, --show-failures, and --overrides to control/inspect conversions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread contrib/recode.pl
Comment thread contrib/recode.pl
Comment thread contrib/recode.pl Outdated
Comment thread contrib/recode.pl
Comment thread contrib/recode.pl
Comment thread contrib/recode.pl
Comment thread contrib/recode.pl Outdated
Comment thread contrib/recode.pl Outdated
@justdave

justdave commented Jun 5, 2026

Copy link
Copy Markdown
Member

My apologies to @MartijnRas for the amount of stuff CoPilot found. It doesn't know you were copying an existing script from elsewhere so it audited the entire script instead of just your changes to it. But most of it is stuff we should probably fix anyway, if you don't mind.

@justdave

justdave commented Jun 5, 2026

Copy link
Copy Markdown
Member

@MartijnRas if you're okay with it, I can commit the suggested fixes from CoPilot. I agree with them, except for the one I resolved already because it was misinformed. :-) (but it's our fault it was misinformed and that's a different bug)

@MartijnRas

MartijnRas commented Jun 5, 2026 via email

Copy link
Copy Markdown
Contributor Author

justdave and others added 2 commits June 5, 2026 17:13
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

@justdave justdave left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have an old database to test this on and I'm not sure where to find one. A visual look at the code looks like it's doing the right thing. We'll have to depend on someone trying it out to tell us if it really works. And it's in contrib which technically means it's unmaintained....

@justdave justdave merged commit 8524fe8 into bugzilla:main Jun 5, 2026
7 checks passed
@MartijnRas

MartijnRas commented Jun 6, 2026 via email

Copy link
Copy Markdown
Contributor Author

@justdave

justdave commented Jun 6, 2026

Copy link
Copy Markdown
Member

For testing this script in particular having summaries and descriptions that are in random character sets from a MySQL that's too old to enforce it would be the stuff the script is aiming to fix.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants