Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
javanesevn #1
Member since Apr 2008 · 74 posts · Location: Japan
Group memberships: Members
Show profile · Link to this post
Subject: Unicode in xml parser
Hi Alex,

When client sent three bytes characters to Openfire server. Sometime these characters are unreadable.
This is server bug.

Should I convert characters to two bytes before sent them to server?

How can agsXMPP api detect characters are 1 byte or 2 bytes or 3 bytes etc.. ?

Thanks.
This post was edited on 2008-12-18, 09:40 by javanesevn.
Avatar
Alex #2
Member since Feb 2003 · 4328 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
XMPP is based on Xml and is using UTF-8 encoded Xml only.
Depending on the Unicode character it gets represented with 1,2,3 or 4 bytes in UTF-8. This is a requirement and there is no way to change it.

If there is a bug in the server you have to wait until this bug is fixed, use another server software or exclude the problematic range of Unicode characters. Excluding characters make no sense to me, because XMPP and UTF-8 is designed to be Unicode compatible.

see also: http://en.wikipedia.org/wiki/UTF-8

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