Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
viraptor #1
Member since Mar 2007 · 2 posts
Group memberships: Members
Show profile · Link to this post
Subject: Ascii control characters in message
Hey
Trying to send ascii control chars (for example \x08) in a message causes client reconnect. It just drops, but doesn't crash or throw exceptions.
Avatar
Jabberer #2
Member since Feb 2006 · 249 posts
Group memberships: Members
Show profile · Link to this post
XMPP is using a subset of XML. This characters are illegal in XML, this is the reason why get disconnected which is correct.
The .NET XmlTextWriter accepts this characters which is wrong and the reason why you can send them ;-).

Why do you need ths characters? For formatting text?
Then you shoud take a look at:
XEP-0071 - XHTML-IM
Software Developer
AG-Software
Avatar
viraptor #3
Member since Mar 2007 · 2 posts
Group memberships: Members
Show profile · Link to this post
Not for formating - I'm writing a bot / service, that sometimes has to send back output from some command. Some generate ^H chars (for example those using /|-\ spinners for progess).
I can filter them of course, but that would be nice, if library threw an exception on this character (or just filtered it) and didn't disconnect mysteriously.
Avatar
Alex #4
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
as Jabberer said we use the XmlTextWriter to serialize the XML which does not throw an exception.
For parsing XML we don't use System.Xml, we use the XP parser which detects invalid xml. For now there are no plans to replace the XmlTextWriter.

If you have to handle such characters and don't care about the bandwidth you could encode the whole content of your messages Base64.

Alex
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: agsXMPP RSS