Answer the question
In order to leave comments, you need to log in
What could be causing the qml Text Cyrillic output error?
There was an unusual problem which solution for a day I did not find. The problem occurs only on 1 PC with Windows 10. When I try to display Russian text in qml Text, instead of Russian letters, characters are displayed, as it seemed to me, the Greek alphabet. The first conclusion is that the encoding is down, but I did not find the mechanism for setting it up for qml. When replacing Text with Label, the text started to be displayed correctly, but for example, in TextEdit it also displays the wrong encoding. When copying and pasting, for example, in notepad ++, the text is displayed correctly. Look like this:
Just in case, the code, although there is nothing special about it.
Connections {
target: QmlModel
onDiagnosticCompleted: {
if(result.length) {
diagnosticResult.text = "Text:" + result;
diagnosticResultLabel.text = "Label:" + result;
}
}
}
RowLayout {
anchors.fill: parent
id: layout
Rectangle {
border.color: "#101010"
border.width: 1
Layout.fillWidth: true
Layout.minimumWidth: 50
Layout.preferredWidth: 100
Layout.maximumWidth: 300
Layout.minimumHeight: 150
Text {
id:diagnosticResult
padding: 5
anchors.fill: parent
z:0
}
}
Rectangle {
border.color: "#101010"
border.width: 1
Layout.fillWidth: true
Layout.minimumWidth: 50
Layout.preferredWidth: 100
Layout.maximumWidth: 300
Layout.minimumHeight: 150
Label {
id:diagnosticResultLabel
anchors.fill: parent
padding: 5
z:0
}
}
}
Answer the question
In order to leave comments, you need to log in
Intermediate result. If you Text
set the property , renderType: Text.NativeRendering
then the text becomes normal. It remains to be seen why this is happening.
Added:
to apply a native render to the entire project, you can insert it qputenv("QML_DISABLE_DISTANCEFIELD", "1");
at the beginning main
or through the function
void QQuickWindow::setTextRenderType(QQuickWindow::TextRenderType renderType)
with parameterQQuickWindow::NativeTextRendering
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question