diff --git a/src/kauthactionreply.h b/src/kauthactionreply.h --- a/src/kauthactionreply.h +++ b/src/kauthactionreply.h @@ -191,6 +191,9 @@ kauth_install_helper_files( ) @endcode + As locale is not inherited, the auth helper will have the text codec explicitly set + to use UTF-8 on unix machines. + The first argument is the cmake target name for the helper executable, which you have to build and install separately. Make sure to INSTALL THE HELPER IN ${KAUTH_HELPER_INSTALL_DIR}, otherwise kauth_install_helper_files will not work. The diff --git a/src/kauthhelpersupport.cpp b/src/kauthhelpersupport.cpp --- a/src/kauthhelpersupport.cpp +++ b/src/kauthhelpersupport.cpp @@ -43,6 +43,9 @@ #include #include +#ifdef Q_OS_UNIX +#include +#endif #include "BackendsManager.h" @@ -76,6 +79,11 @@ { #ifdef Q_OS_UNIX fixEnvironment(); + //As we don't inherit lang, the locale could be something that doesn't support UTF-8. Force it + auto utf8Codec = QTextCodec::codecForName("UTF-8"); + if (utf8Codec) { + QTextCodec::setCodecForLocale(utf8Codec); + } #endif #ifdef Q_OS_OSX