-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix encoding issue in qt_sinks #2862
Conversation
Duplicate of the rejected #2836. Colors ranges must an addressed somehow |
…g to invoke_method_
Oh, I see. The problem is color ranges are byte indices, but they are passed to |
Not sure. This should be debugged. And anyway msg contents should not be changed directly since they may be used by other sinks |
For my use case, the modification works fine. The characters in QTextEdit are normal. The color ranges which were incorrect before the last commit also appears correct. And as long as the underlying string is UTF8-encoded, this modification should work well. In case the changed msg contents affect other sinks, I can make the converted color ranges local variables without changing msg directly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, a link to the source code was missing. See next comment.
This results in 3 Please add a bool flag |
The bool flag |
Thanks @neothenil and @tt4g . Merged. |
QString::fromLatin1
doesn't handle non-latin characters properly. When applied to Chinese characters, the message appeared in QTextEdit looks like corrupted.This PR fixes this issue.