Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 095b6cc

Browse files
elpasonyalldawson
authored andcommittedMay 31, 2021
[windows] Fix form macro encoding from file on windows
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.
1 parent ad21700 commit 095b6cc

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed
 

‎src/gui/qgsattributeform.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1825,6 +1825,7 @@ void QgsAttributeForm::initPython()
18251825
{
18261826
// Read it into a string
18271827
QTextStream inf( inputFile );
1828+
inf.setCodec( "UTF-8" );
18281829
initCode = inf.readAll();
18291830
inputFile->close();
18301831
}

0 commit comments

Comments
 (0)
Please sign in to comment.