[Standards] Proposed XMPP Extension: Character counting in message bodies

Ralph Meijer ralphm at ik.nu
Wed Dec 18 15:11:52 UTC 2019


My assumption was that we are looking at character data on the abstract 
layer /after/ parsing XML. You shouldn't see entities there (they'd be 
resolved to their respective characters), nor should you see <![CDATA[]] 
wrappers.

On 18-12-2019 15:22, Andrew Nenakhov wrote:
> We're totally onboard with this XEP, and it is, in fact, the way we 
> already do count characters for references in all versions of Xabber.
>
> However, there is one important case not addressed in this XEP: XML 
> predefined entities.
>
> Symbols that are to be escaped, as listed in 
> https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references 
> are:
>
> & -- &
> < -- <
> > -- >
> " -- "
> ' - '
>
> Counting symbols will result in different outcomes if we count 
> characters before or after unescaping (from experience, without 
> explicit mention of this problemour developers have spilt exactly 
> 50/50 on this: 2 developers did count before unsecaping and 2 - after)
>
> In the end we have settled for counting characters of escaped string, 
> so to draw *&&&* in a client we count it as string with a length of 
> 15, thus <bold> reference points to characters 0..14:
>
> <reference xmlns="urn:xmpp:reference:0" begin="0" end="14" 
> type="markup"><bold /></reference>
>
> вт, 17 дек. 2019 г. в 16:19, <pep at bouah.net <mailto:pep at bouah.net>>:
>
>     The XMPP Extensions Editor has received a proposal for a new XEP.
>
>     Title: Character counting in message bodies
>     Abstract:
>     This document describes how to correctly count characters in message
>     bodies. This is required when referencing a position in the body.
>
>     URL: https://xmpp.org/extensions/inbox/charcount.html
>
>     The Council will decide in the next two weeks whether to accept this
>     proposal as an official XEP.
>     _______________________________________________
>     Standards mailing list
>     Info: https://mail.jabber.org/mailman/listinfo/standards
>     Unsubscribe: Standards-unsubscribe at xmpp.org
>     <mailto:Standards-unsubscribe at xmpp.org>
>     _______________________________________________
>
>
>
> -- 
> Andrew Nenakhov
> CEO, redsolution, OÜ
> https://redsolution.com <http://www.redsolution.com>
>
> _______________________________________________
> Standards mailing list
> Info: https://mail.jabber.org/mailman/listinfo/standards
> Unsubscribe: Standards-unsubscribe at xmpp.org
> _______________________________________________

-- 
ralphm

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.jabber.org/pipermail/standards/attachments/20191218/55a9f00d/attachment.html>


More information about the Standards mailing list