From 9f461bad6c890d3fe92d89ebf1b6a3f313d7e8ef Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Wed, 22 Apr 2009 15:39:50 +0200 Subject: [PATCH] Always treat the GECOS real name field as UTF8-encoded MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Thanks to Gökçen Eraslan and H. İbrahim Güngör for this. --- src/common/identity.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/identity.cpp b/src/common/identity.cpp index 1978ebe9..0569178a 100644 --- a/src/common/identity.cpp +++ b/src/common/identity.cpp @@ -22,6 +22,7 @@ #include #include +#include #ifdef Q_OS_MAC # include @@ -126,7 +127,7 @@ QString Identity::defaultRealName() { QString realName; struct passwd *pwd = getpwuid(getuid()); if(pwd) - realName = pwd->pw_gecos; + realName = QString::fromUtf8(pwd->pw_gecos); if(!realName.isEmpty()) return realName; else -- 2.20.1