-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
fix: use user-preferred locale #5444
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Previous fix adding `L` format specifier was correct but only fixed half of the problem, as C++ locale is set up to be "C" by default. GTK client used to call `setlocale(LC_ALL, "")` to set up user-preferred locale which only affected C functions and `std::locale` (used by libfmt) was unaware of those changes. Apply the fix to all the binaries since they're all doing some sort of output to the user and calling libtransmission helpers, as well as using libfmt directly.
Set the locale C++ way to avoid any sort of inconsistencies, and also restore it to the old one once finished testing.
Quote outputs to avoid CMake error about `message()` being called with no arguments. Capture stderr to the same output file. Fallback to `git diff` if `diff` wasn't found. A few other minor changes.
dba7490
to
437cb18
Compare
Notes: Fixed bug that caused the wrong decimal separator to be used in some locales. |
ckerr
pushed a commit
that referenced
this pull request
Apr 27, 2023
* Use user-preferred locale Previous fix adding `L` format specifier was correct but only fixed half of the problem, as C++ locale is set up to be "C" by default. GTK client used to call `setlocale(LC_ALL, "")` to set up user-preferred locale which only affected C functions and `std::locale` (used by libfmt) was unaware of those changes. Apply the fix to all the binaries since they're all doing some sort of output to the user and calling libtransmission helpers, as well as using libfmt directly. * Improve libtransmission's json-test Set the locale C++ way to avoid any sort of inconsistencies, and also restore it to the old one once finished testing. * Improve transmission-show test runner script Quote outputs to avoid CMake error about `message()` being called with no arguments. Capture stderr to the same output file. Fallback to `git diff` if `diff` wasn't found. A few other minor changes.
mtremer
pushed a commit
to ipfire/ipfire-2.x
that referenced
this pull request
Aug 30, 2023
- Update from version 4.0.3 to 4.0.4 - Update of rootfile not required. - Changelog Transmission 4.0.4 This is a bugfix-only release. Everyone's feedback on 4.0.x has been very helpful -- thanks for all the suggestions, bug reports, and pull requests! What's New in 4.0.4 All Platforms * Fixed bug in sending torrent metadata to peers. ([#5460](transmission/transmission#5460)) * Avoid unnecessary heap memory allocations. ([#5520](transmission/transmission#5520), [#5527](transmission/transmission#5527)) * Fixed filename collision edge case when renaming files. ([#5563](transmission/transmission#5563)) * Fixed locale errors that broke number rounding when displaying statistics, e.g. upload / download ratios. ([#5587](transmission/transmission#5587)) * Always use a fixed-length key query in tracker announces. This isn't required by the [spec](https://www.bittorrent.org/beps/bep_0007.html), but some trackers rely on that fixed length because it's common practice by other BitTorrent clients. ([#5652](transmission/transmission#5652)) * Fixed potential Windows crash when [getstdhandle()](https://learn.microsoft.com/en-us/windows/console/getstdhandle) returns `NULL`. ([#5675](transmission/transmission#5675)) * Fixed `4.0.0` bug where the port numbers in LDP announces are sometimes malformed. ([#5825](transmission/transmission#5825)) * Fixed a bug that prevented editing the query part of a tracker URL. ([#5871](transmission/transmission#5871)) * Fixed a bug where Transmission may not announce LPD on its listening interface. ([#5896](transmission/transmission#5896)) * Made small performance improvements in libtransmission. ([#5715](transmission/transmission#5715)) macOS Client * Updated code that had been using deprecated API. ([#5633](transmission/transmission#5633)) Qt Client * Fixed torrent name rendering when showing magnet links in compact view. ([#5491](transmission/transmission#5491)) * Fixed bug that broke the "Move torrent file to trash" setting. ([#5505](transmission/transmission#5505)) * Fixed Qt 6.4 deprecation warning. ([#5552](transmission/transmission#5552)) * Fixed poor resolution of Qt application icon. ([#5570](transmission/transmission#5570)) GTK Client * Fixed missing 'Remove torrent' tooltip. ([#5777](transmission/transmission#5777)) Web Client * Don't show `null` as a tier name in the inspector's tier list. ([#5462](transmission/transmission#5462)) * Fixed truncated play / pause icons. ([#5771](transmission/transmission#5771)) * Fixed overflow when rendering peer lists and made speed indicators honor `prefers-color-scheme` media queries. ([#5814](transmission/transmission#5814)) * Made the main menu accessible even on smaller displays. ([#5827](transmission/transmission#5827)) transmission-cli * Fixed "no such file or directory" warning when adding a magnet link. ([#5426](transmission/transmission#5426)) * Fixed bug that caused the wrong decimal separator to be used in some locales. ([#5444](transmission/transmission#5444)) transmission-remote * Fixed display bug that failed to show some torrent labels. ([#5572](transmission/transmission#5572)) Everything Else * Ran all PNG files through lossless compressors to make them smaller. ([#5586](transmission/transmission#5586)) * Fixed potential build issue when compiling on macOS with gcc. ([#5632](transmission/transmission#5632)) Signed-off-by: Adolf Belka <adolf.belka@ipfire.org> Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previous fix adding
L
format specifier was correct but only fixed half of the problem, as C++ locale is set up to be "C" by default. GTK client used to callsetlocale(LC_ALL, "")
to set up user-preferred locale which only affected C functions andstd::locale
(used by libfmt) was unaware of those changes.Apply the fix to all the binaries since they're all doing some sort of output to the user and calling libtransmission helpers, as well as using libfmt directly.
Fixes: #5284