Bug 469797 nsUserInfo::GetFullname assumes ASCII name on Linux based systems. r=bsmedberg

This commit is contained in:
Mark Banner 2009-01-06 08:40:54 +00:00
Родитель ad7af36959
Коммит 7f59975db5
1 изменённых файлов: 5 добавлений и 1 удалений

Просмотреть файл

@ -47,6 +47,7 @@
#include "nsString.h"
#include "nsXPIDLString.h"
#include "nsReadableUtils.h"
#include "nsNativeCharsetUtils.h"
/* Some UNIXy platforms don't have pw_gecos. In this case we use pw_name */
#if defined(NO_PW_GECOS)
@ -99,7 +100,10 @@ nsUserInfo::GetFullname(PRUnichar **aFullname)
fullname.ReplaceSubstring("&", username.get());
}
*aFullname = ToNewUnicode(fullname);
nsAutoString unicodeFullname;
NS_CopyNativeToUnicode(fullname, unicodeFullname);
*aFullname = ToNewUnicode(unicodeFullname);
if (*aFullname)
return NS_OK;