I can not access the Russian user and his AppData\Local , where configs are generated, generated in Python . qgetenv("USERNAME") returns either question marks or unreadable characters. The variants with .toUtf8 , .toLocal8Bit , .toLatin1 , QTextCodec , toStdString , toStdWString have been tried. Maybe I'm doing something wrong? Please help.

Qt5.6 version used , VS2015 compiler, CMake build.

    1 answer 1

    To get the paths to the standard directories, there is a special QStandardPaths class. Specifically for your problem, the solution will look like this:

     QStandardPaths::displayName(QStandardPaths::GenericDataLocation); 

    We need to see what exactly it will return, because judging by the documentation, there may be several ways - in this case, you will need to choose one.