Skip to content
This repository has been archived by the owner on Jun 11, 2020. It is now read-only.

Empty messages on some unusual utf8 #118

Open
hilesaz opened this issue May 10, 2014 · 4 comments
Open

Empty messages on some unusual utf8 #118

hilesaz opened this issue May 10, 2014 · 4 comments

Comments

@hilesaz
Copy link

hilesaz commented May 10, 2014

In InputTextWidget::keyPressEvent a message that starts with U+FFFC will be passed through toPlaintext normally (so not get culled) but will end up as an empty

when passed through toHtml.

@nurupo
Copy link
Owner

nurupo commented May 10, 2014

Looks like QTextEdit treats U+FFFC as a special character and there is no way to escape it.

Anyway, there are many special and noncharacter characters in utf8, so it makes sense to sanitize user input.

@msteinbeck
Copy link

Anyway, there are many special and noncharacter characters in utf8, so it makes sense to sanitize user input.

Which spacial characters do you mean? That one listed here?
http://de.wikipedia.org/wiki/Unicodeblock_Spezielles

@nurupo
Copy link
Owner

nurupo commented May 22, 2014

Well, U+FFFC is used internally by QTextEdit engine and there seem to be no workaround for that.

Which spacial characters do you mean?

Like the object replacement character U+FFFC and noncharacters from the Arabic block (U+FDD0 - U+FDEF), though I'm sure there are still many others.

That one listed here?
http://de.wikipedia.org/wiki/Unicodeblock_Spezielles

Can't read Deutsch, but yes, some of them.

@msteinbeck
Copy link

Can't read Deutsch, but yes, some of them.

oops :D

I think the most simple fix would be to replace all "U+FFFC" inside the event with an empty string. I already have a patch for this but sending a PR will end in a (small) merge conflict with #120.

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

No branches or pull requests

3 participants