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

Reply-to fallback character counting issue with non ASCII chars #1420

Closed
truenicoco opened this issue Apr 5, 2023 · 4 comments
Closed

Reply-to fallback character counting issue with non ASCII chars #1420

truenicoco opened this issue Apr 5, 2023 · 4 comments

Comments

@truenicoco
Copy link

I think dino does not count code points correctly, see these two (partial) stanzas sent by dino:

<body>&gt; base
bose</body>
<fallback xmlns="urn:xmpp:fallback:0" for="urn:xmpp:reply:0"><body end="7" start="0" />

<body>&gt; bäse
bose</body>
<fallback xmlns="urn:xmpp:fallback:0" for="urn:xmpp:reply:0"><body end="8" start="0" />

Changing a to ä made dino count an extra character, but I don't think that's conform to XEP-0426

@singpolyma
Copy link
Contributor

I ran into this today too, dino seems to both send and receive counts in bytes rather than in codepoints.

@Zash
Copy link
Contributor

Zash commented Apr 29, 2023

image

Replying to messages with a trailing emoji seems to prevent the reply from rendering, possibly because the emoji gets cut in two and some invalid UTF-8 is produced. In the above screenshot, they replied with "Reply", but this is nowhere to be seen.

@fiaxh fiaxh closed this as completed in 0bddf9f May 1, 2023
@fiaxh
Copy link
Member

fiaxh commented May 1, 2023

Dino uses codepoints now.

@singpolyma I tested with Cheorgram and it seems that it actually also counts wrong and thus Dino and Cheogram aren't compatible yet.

For this message

> test 😀
Test

Cheogram attaches

<fallback xmlns='urn:xmpp:fallback:0' for='urn:xmpp:reply:0'>
    <body start='0' end='10' />
  </fallback>

However, the end should be after codepoint 9.

@singpolyma
Copy link
Contributor

@fiaxh thanks for this, it seems I am using java code units instead of code points. will fix

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

No branches or pull requests

4 participants