use_converter_cache = false;
converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
- user_name = support::user_name();
+ user_name = to_utf8(support::user_name());
- user_email = support::user_email();
+ user_email = to_utf8(support::user_email());
}
namespace lyx {
namespace support {
-string const user_name()
+docstring const user_name()
{
#if defined (_WIN32)
char name[UNLEN + 1];
DWORD size = UNLEN + 1;
if (!GetUserName(name, &size))
- return lyx::to_utf8(_("Unknown user"));
- return name;
+ return _("Unknown user");
+ return from_local8bit(name);
#else
struct passwd * pw(getpwuid(geteuid()));
BOOST_ASSERT(pw);
string name = pw->pw_gecos;
if (name.empty())
name = pw->pw_name;
- return name;
+ return from_local8bit(name);
#endif
}
-string const user_email()
+docstring const user_email()
{
string email = getEnv("EMAIL_ADDRESS");
if (email.empty())
email = getEnv("EMAIL");
- return email;
+ return from_local8bit(email);
}
} // namespace support
#ifndef USERINFO_H
#define USERINFO_H
-#include <string>
+#include "support/docstring.h"
namespace lyx {
namespace support {
/// return the current user's real name
-std::string const user_name();
+docstring const user_name();
/// return the current user's e-mail address
-std::string const user_email();
+docstring const user_email();
} // namespace support
} // namespace lyx