Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Unicode escapes when properties files are both valid UTF-8 and ISO-8859-1 #6550

Merged
merged 2 commits into from
May 10, 2022

Conversation

timja
Copy link
Member

@timja timja commented May 8, 2022

See jenkinsci/stapler#357
and #6546 (comment)

Ran with https://gist.github.com/timja/21d655840f5d617df07a271a7db0a48f

and then paths outputted to a file and native2ascii used over top:

cat /tmp/files.txt | xargs -I {} -n 1 bash -c "native2ascii {} > /tmp/ascii.txt && mv /tmp/ascii.txt {}"

Proposed changelog entries

  • Correct encoding for several localized strings.

Proposed upgrade guidelines

N/A

Submitter checklist

  • (If applicable) Jira issue is well described
  • Changelog entries and upgrade guidelines are appropriate for the audience affected by the change (users or developer, depending on the change) and are in the imperative mood. Examples
    • Fill-in the Proposed changelog entries section only if there are breaking changes or other changes which may require extra steps from users during the upgrade
  • Appropriate autotests or explanation to why this change has no tests
  • New public classes, fields, and methods are annotated with @Restricted or have @since TODO Javadoc, as appropriate.
  • For dependency updates: links to external changelogs and, if possible, full diffs

Desired reviewers

@mention

Maintainer checklist

Before the changes are marked as ready-for-merge:

  • There are at least 2 approvals for the pull request and no outstanding requests for change
  • Conversations in the pull request are over OR it is explicit that a reviewer does not block the change
  • Changelog entries in the PR title and/or Proposed changelog entries are accurate, human-readable, and in the imperative mood
  • Proper changelog labels are set so that the changelog can be generated automatically
  • If the change needs additional upgrade steps from users, upgrade-guide-needed label is set and there is a Proposed upgrade guidelines section in the PR title. (example)
  • If it would make sense to backport the change to LTS, a Jira issue must exist, be a Bug or Improvement, and be labeled as lts-candidate to be considered (see query).

@timja timja added the skip-changelog Should not be shown in the changelog label May 8, 2022
@timja timja requested review from basil, NotMyFault and jglick May 8, 2022 07:15
Copy link
Member

@basil basil left a comment

Choose a reason for hiding this comment

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

I just merged a different localization PR so it would be nice to confirm that there are no conflicts.

@basil
Copy link
Member

basil commented May 8, 2022

This PR is now ready for merge. We will merge it after approximately 24 hours if there is no negative feedback. Please see the merge process documentation for more information about the merge process. Thanks!

@basil basil added the ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback label May 8, 2022
@basil basil changed the title Use unicode escapes when both valid utf-8 and ISO-8859-1 Use Unicode escapes when properties files are both valid UTF-8 and ISO-8859-1 May 8, 2022
@basil
Copy link
Member

basil commented May 8, 2022

As far as I can tell, this should be labelled bug and not skip-changelog, because it contains changes to Messages*.properties, which are handled by this code which is already using PropertyResourceBundle (i.e., presumably already showing mojibake when running on Java 9+).

@basil
Copy link
Member

basil commented May 8, 2022

In fact #6382 seems to have been an attempt to address one symptom of this problem, but the fix was incomplete. This PR eradicates the problem.

@basil basil added bug For changelog: Minor bug. Will be listed after features and removed skip-changelog Should not be shown in the changelog labels May 8, 2022
@timja
Copy link
Member Author

timja commented May 8, 2022

I just merged a different localization PR so it would be nice to confirm that there are no conflicts.

No new issues from merging master locally

@jglick
Copy link
Member

jglick commented May 9, 2022

Worth adding to

* Runs checks on properties files in core.
to prevent accidental regression?

@timja
Copy link
Member Author

timja commented May 10, 2022

@timja timja merged commit bbd7ca2 into jenkinsci:master May 10, 2022
@timja timja deleted the use-unicode-escapes branch May 10, 2022 06:32
NotMyFault pushed a commit to NotMyFault/jenkins that referenced this pull request May 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug For changelog: Minor bug. Will be listed after features ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants