mirror of
https://github.com/XuehaiPan/nvitop.git
synced 2026-05-15 14:15:55 -06:00
[PR #15] [MERGED] Fix locale encoding when C.UTF-8 is not available #121
Labels
No labels
api
bug
bug
cli / tui
dependencies
documentation
documentation
documentation
duplicate
enhancement
exporter
invalid
pull-request
pynvml
question
question
upstream
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/nvitop#121
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/XuehaiPan/nvitop/pull/15
Author: @XuehaiPan
Created: 4/19/2022
Status: ✅ Merged
Merged: 4/19/2022
Merged by: @XuehaiPan
Base:
dev← Head:fix-locale-utf8📝 Commits (1)
1c2744efix(gui/libcurses): fix locale encoding whenC.UTF-8is not available📊 Changes
4 files changed (+22 additions, -26 deletions)
View changed files
📝
nvitop/cli.py(+5 -14)📝
nvitop/gui/__init__.py(+2 -1)📝
nvitop/gui/library/__init__.py(+1 -1)📝
nvitop/gui/library/libcurses.py(+14 -10)📄 Description
Issue Type
Runtime Environment
3.6.8512.15nvitopversion or commit:dev@93926f3python-ml-pyversion:11.450.51en_US.UTF-8Description
The fresh installed CentOS 7 does not have locale
C.UTF-8.nvitopsets the locale setting toCwhich does not support Unicode box-drawing characters. However the system default, which isen_US.utf8, does support Unicode characters.93926f3865/nvitop/gui/library/libcurses.py (L88-L97)Motivation and Context
Reorder locale encoding detection. Let the system default (
setlocale(LC_ALL, '')) precedessetlocale(LC_ALL, 'C'). Fix box-drawing on CentOS 7.Fixes #14
Testing
Tested on CentOS 7 docker container.
Images / Videos
Set locale to
C:Set locale to system default:
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.