Skip to content
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

Fixed conversion to std::wstring #554

Merged
merged 1 commit into from
Jun 27, 2024
Merged

Fixed conversion to std::wstring #554

merged 1 commit into from
Jun 27, 2024

Conversation

tsujan
Copy link
Member

@tsujan tsujan commented Jun 25, 2024

Fixes lxqt/qterminal#1143 and related issues.

@tsujan
Copy link
Member Author

tsujan commented Jun 25, 2024

Tested by me, and especially by @correabuscar, but I prefer to wait for more tests before merging it. IMO, we'll need a point release after that.

auto encoded = _fromUtf8(str);
std::wstring unicodeText = encoded.data.toStdWString();
QByteArray ba(text, length);
QString str = _toUtf16(ba);

This comment was marked as resolved.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you wanted to be a lil more specific here...

They're exactly the same thing.

and if you wanted to be even more explicit,...

Not to this extent ;)

This comment was marked as resolved.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only suggested it because I saw you do this:

Yes, I guessed that :) I did so only to prevent confusion for code readers (we have a decoder now, not an encoder).

@tsujan tsujan merged commit c358cdb into master Jun 27, 2024
2 checks passed
@tsujan tsujan deleted the fixed_wstring branch June 27, 2024 11:20
@correabuscar
Copy link

I could only test this under X11, but I don't see why it wouldn't work the same on Wayland

@tsujan
Copy link
Member Author

tsujan commented Jun 27, 2024

I work under Wayland (LXQt+LabWC). And you're right: Wayland doesn't make a difference in this regard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

replacement character aka appears out of nowhere sometimes
2 participants