[ejabberd] Help me diagnose this error when registering over xmlrpc

Eric Chamberlain eric at ringfree.com
Fri May 20 02:19:54 MSD 2011

On May 19, 2011, at 3:00 AM, Badlop wrote:

> Maybe you are not running exactly my script:
> check that the username is written using UTF-8 in your local file.
> I use this dirty way to check the encoding:
> $ mv register.py register.py.txt
> $ firefox register.py.txt
> Then I go in the browser menus, and I select Character Encoding: Unicode (UTF-8)
> And the username is displayed correctly, so I know the python script
> contains it in the correct encoding.

This is definitely an encoding issue, but I'm still trying to track down where.

I can register this user with the web interface and from the command line using ejabberdctl.

Using that script you sent, I've tried:

# -*- coding: utf-8 -*-
params["user"] = u'الخبراني'


params["user"] = u'\u0627\u0644\u062e\u0628\u0631\u0627\u0646\u064a'


params["user"] = '\xd8\xa7\xd9\x84\xd8\xae\xd8\xa8\xd8\xb1\xd8\xa7\xd9\x86\xd9\x8a'

All produce identical errors in ejabberd.log.

The xmlrpc register request user value is encoded as:


Which does match (when converted to decimal) what you sent me before:


but does not match the stringprep results in the error log:

=ERROR REPORT==== 2011-05-19 17:56:49 ===

Could you rerun your script with:

server = xmlrpclib.Server(server_url,verbose=True)

And send me the output?  I want to confirm that what my xmlrpclib is sending to ejabberd is the same as what yours is sending.

If the xmlrpc register request user values match, could the problem be with the CentOS erlang-xmlrpc package?

Installed Packages
Name       : erlang-xmlrpc
Arch       : i386
Version    : 1.13
Release    : 2.el5
Size       : 110 k
Repo       : installed
Summary    : HTTP 1.1 compliant XML-RPC library for Erlang
URL        : http://github.com/rwbr/exmlrpc
License    : BSD
Description: HTTP 1.1 compliant XML-RPC library for Erlang.

Eric Chamberlain

More information about the ejabberd mailing list