Red Hat Bugzilla – Bug 501184
Header misalignment with multibyte characters
Last modified: 2010-04-09 04:08:25 EDT
Description of problem:
The header linse of e.g. "semanage user -l" gets misaligned if the translated headers contain UTF-8 multibyte characters.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. env LANG=sv_SE.utf8 semanage user -l
Märkning MLS/ MLS/
SELinux-anv. Prefix MCS-nivå MCS-intervall SELinux-roller
guest_u user s0 s0 guest_r
root user s0 SystemLow-SystemHigh staff_r sysadm_r system_r unconfined_r
staff_u user s0 SystemLow-SystemHigh staff_r sysadm_r system_r
sysadm_u user s0 SystemLow-SystemHigh sysadm_r
system_u user s0 SystemLow-SystemHigh system_r
unconfined_u unconfined s0 SystemLow-SystemHigh system_r unconfined_r
user_u user s0 s0 user_r
xguest_u user s0 s0 xguest_r
I hope bugzilla won't mangle the formatting. The point here is that "MLS/" is one space to the left of where it should be. Likewise with "MCS-intervall" and "SELinux-roller". Presumably because of the "ä" in "Märkning" and the "å" in "MLS-nivå".
This is shown using a po file I just uploaded where "SELinux-anv." is abbreviated as shown above. Before it was spelled out "SELinux-användare", which made the header overflow. It was when I corrected the overflow in the translation I noticed this other problem.
Any idea how to fix this?
I didn't have any. But I took help from some friends/colleagues who know Python much better than I do. With their advice, and a bit of experimentation, I came up with this fix. Having applied it, the output looks fine in both sv_SE.utf8 (an UTF-8 locale) and in sv_SE (a Latin-1 locale).
--- /usr/sbin/semanage.orig 2009-06-12 22:24:31.000000000 +0200
+++ /usr/sbin/semanage 2009-11-03 16:14:10.000000000 +0100
@@ -32,7 +32,7 @@
codeset = 'utf-8')
(Well, it WILL look nice after I fixed the translation. The current version translates "SELinux User" with "SELinux-användare" which doesn't fit in the 15 positions available. But I will change that to an abbreviation.)
This message is a reminder that Fedora 10 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 10. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora
'version' of '10'.
Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version prior to Fedora 10's end of life.
Bug Reporter: Thank you for reporting this issue and we are sorry that
we may not be able to fix it before Fedora 10 is end of life. If you
would still like to see this bug fixed and are able to reproduce it
against a later version of Fedora please change the 'version' of this
bug to the applicable version. If you are unable to change the version,
please add a comment here and someone will do it for you.
Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.
The process we are following is described here:
Remains in policycoreutils-2.0.74-17.fc12.x86_64. And my little patch from comment 2 still works for me.
Fixed in policycoreutils-2.0.77-1.fc12
Does indeed work now. (Tested with 2.0.79.)