Skip to content

Commit

Permalink
[windows] Fix form macro encoding from file on windows
Browse files Browse the repository at this point in the history
When loading a python file in a form on windows, the file is opened using the default system encoding (which may be different than UTF8, at least it wasn't on my tests and on my customer machines).

This patch makes UTF8 the codec used when loading python files from the filesystem before using them for a form.
  • Loading branch information
elpaso authored and nyalldawson committed Jun 14, 2021
1 parent c9f1d42 commit 2cc9263
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/gui/qgsattributeform.cpp
Expand Up @@ -1825,6 +1825,7 @@ void QgsAttributeForm::initPython()
{
// Read it into a string
QTextStream inf( inputFile );
inf.setCodec( "UTF-8" );
initCode = inf.readAll();
inputFile->close();
}
Expand Down

0 comments on commit 2cc9263

Please sign in to comment.