Bug 74058 - utf-8 encoding of pw_gecos; last login time
Summary: utf-8 encoding of pw_gecos; last login time
Alias: None
Product: Fedora
Classification: Fedora
Component: system-config-users   
(Show other bugs)
Version: rawhide
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Brent Fox
QA Contact:
: 78382 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2002-09-14 01:33 UTC by Miloslav Trmac
Modified: 2007-11-30 22:10 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-04-19 19:29:47 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Replace the separate labels by a single one and use strftime (8.34 KB, patch)
2004-04-15 06:25 UTC, Miloslav Trmac
no flags Details | Diff
The same, but convert stftime () result to UTF-8 (8.65 KB, patch)
2004-04-17 14:41 UTC, Miloslav Trmac
no flags Details | Diff

Description Miloslav Trmac 2002-09-14 01:33:47 UTC

1) When creating accounts in anaconda, I can use non-ASCII chars for the
pw_gecos filed ("user name") and they are stored as UTF-8. redhat-config-users
seems to use
iso-8859-1 or something, definitely not UTF-8.

2) Select a user, view properties: the "last password change time" is in en_US
format regardless of user locale (try cs_CZ)


Comment 1 Miloslav Trmac 2002-10-05 23:47:39 UTC
The 2nd issue same in 8.0, haven't checked the first one.
Just noticed that rh-c-users doesn't allow adding users with
pw_gecos not in iso-8859-1 (the 'OK' button doesn't work,
error messages in .xsession-errors)

Comment 2 Starchild 2002-10-27 19:05:41 UTC
Ok, my problem seems related...

When installing, I picked swedish as laguage.
I set up two user-accounts in anaconda, both containg the character 'v' in the
'real name'.

When I later looked at them in rh-c-users, there was a wierd combination of
characters there instead in the place of 'v'. I tried to change them, so that it
would read 'v' instead, but when I did, the account promtly dissapeared from
view. They havn't come back since. The account still exists though.

The same happend with ther other account, when I tried to fix that as well.

New accounts created with the character 'v' in the 'real name', works fine though.

Comment 3 Starchild 2002-10-27 19:44:37 UTC
comment my last comment... The character was not a 'v' or 'v', it was an o with
two dots over it. For some reason it shows up as 'v' in the post. shows up
normally when typing.

Comment 4 Brent Fox 2002-11-26 18:43:17 UTC
*** Bug 78382 has been marked as a duplicate of this bug. ***

Comment 5 Miloslav Trmac 2003-01-06 19:44:42 UTC
Same in phoebe.

Comment 6 Brent Fox 2003-01-08 04:57:57 UTC
Miloslav, sorry that I have taken so long to address this bug.  Let's fix one
thing at a time.  With the first issue that you reported, exactly what did you
expect the behavior to be?

And with Phoebe, you aren't creating users with anaconda.  Rather, you can
create a user in firstboot.  Is there still a problem?

Comment 7 Miloslav Trmac 2003-01-08 17:23:59 UTC
Yes, the problem is the same with Phoebe. Firstboot allows using
full UTF-8 in pw_gecos, but rhc-users doesn't show it in UTF-8.

I expected the whole system (which uses UTF-8 by default) to use
the pw_gecos as is, in UTF-8 (I don't care that much, but I have
seen users who use capitalization and *spaces* even for the user
name). This mostly works, except for rhc-users.

Given that pw_gecos can't be locale-specific, and that UTF-8 is
the default encoding for most languages supported in RHL, I would
expect either allowing full UTF-8.

There is a potential trouble with people not using UTF-8, but
firstboot runs in UTF-8 and has no way to know that the user will
switch, so the user has to change it manually (Note that this
is exactly the current behavior).

Mainly, I think that the used encoding must be specified
and used consistently, both in firstboot and rhc-users (on both display
and entering new data).
The only "completely safe" way is restricting to ASCII, but I think
that using current system locale (from /etc/sysconfig/i18n) would
give good results:
+ users that don't care about locales get full UTF-8
+ users that switch locales can add users and edit pw_gecos
  using specified character set (i.e. iso-8859-2 in my case,
  Miloslav Trmač can't be specified in iso-8859-1).
- if the user changes system locale, rendering some pw_gecos
  entries invalid, they have to change them when editing that
  account with rhc-users.
  This is *exactly* the same problem as now, except that
  now the user is restricted to iso-8859-1, which is different
  from the locale really used (e.g. I can set © in rhc-users,
  even if my system encoding is iso-8859-2, which doesn't have the character).

Gee, this is too long... Anyway, I hope it answers your question.

Comment 8 Brent Fox 2003-01-16 08:07:15 UTC
Issue number one should be fixed in redhat-config-users-1.1.3-2.  After talking
with some of the other developers, I've decided to force ascii only input. 
Trying to deal with all these different encodings is just a nightmare, so
requiring ascii input should fix the problem.  It's not the very best approach,
but it works.

QA, please verify.

Comment 9 David Balažic 2003-01-30 19:15:27 UTC
Just an info point : phoebe2 ( 8.0.93 ), redhat-config-users-1.1.3-1

If I enter a non-ascii character in "real name" ( zcaron : ž ) and then click 
on OK, the dialog hangs.

Hey, I want UTF-8 :-)

Comment 10 Miloslav Trmac 2003-02-12 20:25:43 UTC
Restricting to ASCII works for me with 8.0.93 +RHN (at least testing on my 
name), thanks.

To return to the original second issue,
last password change time is still using English.

Comment 11 Brent Fox 2003-05-25 14:31:20 UTC
There is a stack of 64 bugs that have been in Modified state for a long period
of time.  I am closing these as Rawhide now.  If you find that the issue is not
fixed, please reopen this report.

Comment 12 Miloslav Trmac 2004-04-08 13:10:01 UTC
I have missed this one...
The last password change time is still (system-config-users-1.2.11-3)
in English.

Assuming LC_TIME is set correctly, it should be as easy as
        time.strftime("%c", time.gmtime(...))
in userProperties.py

Comment 13 Brent Fox 2004-04-14 18:20:19 UTC
I don't really have a good way to fix this.  strftime returns tuples
of different length depending on the locale being used.  This makes it
really hard to split up the tuple and put the right tokens into the
right GtkLabels.  

I can either leave the widgets the way they are or I can remove those
widgets altogether.  I guess the information on when the password was
last changed is not terribly useful.

Comment 14 Miloslav Trmac 2004-04-15 06:25:31 UTC
Created attachment 99439 [details]
Replace the separate labels by a single one and use strftime

I admit I have missed that, but AFAICS there is no reason
to have separate labels there; using a single label also
better adapts to locale-specific ordering of information
in the date.

Comment 15 Brent Fox 2004-04-15 21:46:34 UTC
That patch doesn't quite work for me.  strftime seems to be returning
me some non-utf8 text which prevents me from passing the text into a
GtkLabel.  I get the following error:

** (system-config-users.py:13693): WARNING **: Invalid UTF8 string
passed to pango_layout_set_text()

Comment 16 Miloslav Trmac 2004-04-17 14:41:14 UTC
Created attachment 99509 [details]
The same, but convert stftime () result to UTF-8

Sorry, I have forgotten about non-UTF-8 locales. This should fix it.

Comment 17 Brent Fox 2004-04-19 19:29:47 UTC
Patch applied in system-config-users-1.2.12-4 in Rawhide.  Thanks for
the patch.

Note You need to log in before you can comment on or make changes to this bug.