You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Qt5, when saving and reloading a file with special characters like mu, degree... , these characters are wrongly displayed (usually replaced by ?)
[Issue created by M. Gronle: 2015-01-29]
[Comment created by M. Gronle: 2015-01-29]
fixes issue #32 (Qt4/5 encoding error). In Qt5 QString(QByteArray ba) assumes that ba is utf8 encoded, in Qt4 it assumed ascii (latin1). Now, the optional language::codec setting parameter defines the codec for reading and writing python script files (default: latin1). Additionally, the python codec for stdout and stderr stream is set to latin1 and the itom-stream class handles every input to be latin1 decoded.
[Comment created by Johann Krauter: 2015-01-29]
In Qt4, QScintilla was set to utf8 mode, scripts are loaded with utf8 standard in scriptEditorWidget::openFile and saved to latin1 in scriptEditorWidget::saveFile. Since the command line was in utf8, single commands to python have been converted to utf8 in PythonEngine::runString.
QString text = QString::fromLatin1(file.readAll());
In Qt5, it seems that the latin1 coded file must be read with utf8 standard and QScintilla returns a latin1 encoded string in its text-method such that python needs to get a toLatin1() decoded byte-array.
The text was updated successfully, but these errors were encountered:
In Qt5, when saving and reloading a file with special characters like mu, degree... , these characters are wrongly displayed (usually replaced by ?)
[Issue created by M. Gronle: 2015-01-29]
[Comment created by M. Gronle: 2015-01-29]
fixes issue #32 (Qt4/5 encoding error). In Qt5 QString(QByteArray ba) assumes that ba is utf8 encoded, in Qt4 it assumed ascii (latin1). Now, the optional language::codec setting parameter defines the codec for reading and writing python script files (default: latin1). Additionally, the python codec for stdout and stderr stream is set to latin1 and the itom-stream class handles every input to be latin1 decoded.
→ <<cset 0eb9449>>
[Comment created by Johann Krauter: 2015-01-29]
In Qt4, QScintilla was set to utf8 mode, scripts are loaded with utf8 standard in scriptEditorWidget::openFile and saved to latin1 in scriptEditorWidget::saveFile. Since the command line was in utf8, single commands to python have been converted to utf8 in PythonEngine::runString.
QString text = QString::fromLatin1(file.readAll());
In Qt5, it seems that the latin1 coded file must be read with utf8 standard and QScintilla returns a latin1 encoded string in its text-method such that python needs to get a toLatin1() decoded byte-array.
The text was updated successfully, but these errors were encountered: