[jdev] Escaping JID using XEP-0106

Mridul Muralidharan mridul at sun.com
Wed Jun 27 10:33:16 CDT 2007

Sergei Golovan wrote:
> On 6/27/07, Mridul Muralidharan <mridul at sun.com> wrote:
>> It is not about visual representation.
>> xep 106 is about encoding pieces of the jid such that they are compliant
>> with xmpp requirements in a standard way.
> Then I would like to ask who should escape JIDs and when? I don't
> think that users will read XEP and escape desired characters.
> One possible question is: user's client during registration process.
> And user will be surprised looking at his new brand escaped JID.


   There are deployments where uid's are standardized - like using email 
id. So the user id is user at maildomain, and the full jid would be 
user\40maildomain at imdomain
The client would take in user at maildomain as userid, imdomain as the xmpp 
domain and then construct the jid appropriately (using the xep specified 
encoding). At the server, it would retrieve the individual parts, 
unescape each and uniquely identify the uid to be used for that user in 
that xmpp domain (property store, authentication, etc).

I am just giving a possible usecase (albeit something which is supported 
by us for example) - you can come up with many others too.
In the above example, if the user wants to put his JID in his business 
card, he will need to specify "user\40maildomain at imdomain" - since that 
is his xmpp jid to which he is accessible at (if imdomain is a federated 
server for example) - just like he would put "user at maildomain" as his email.

Hope this clarifies and also gives one usecase of how escaping and 
unescaping are required.


More information about the JDev mailing list