2

I have a situation.

Working with an ejabberd module, i could successfully input English strings e.g. "test" which was initially parsed from an HTTP header as <<"test">>.

However, now when i am trying different language inputs say Hindi or Hebrew, my module fails. I am not sure at what end (client/server) what exactly is required.

Would some sort of encoding UTF-8 or Base-64 lead to auto handling of several languages?

FYI, when i do the following:

    httpConn.setRequestProperty("GROUPNAME", "विकिपीडिया");

here विकिपीडिया is the Hindi equivalent for Wikipaedia.

My ejabberd writes this into mnesia as:

 [224,164,181,224,164,191,224,164,149,224,164,191,224,164,170,224,165,128,224,164,161,224,164,191,224,164,175,224,164,190]

which is apparently Raw binary data (i guess).

Please provide your inputs as to where and what kind of approach in design would handle all the diferent language strings.

I have an Android client which posts this विकिपीडिया as part of http header to the ejabberd. However, it is never able to construct this at the recipient end.

All i see is a string of ?-marks i.e

????????????????

What am i missing?

Raina M
  • 123
  • 1
  • 6
  • ejabberd is unicode compliant. There is nothing special to do in ejabberd to support any languages. In practice, ejabberd is used with success all around the world in any languages (Chineese, Russian, Japanese, etc.) – Mickaël Rémond Jun 02 '15 at 08:00

1 Answers1

0

I don't know the specifics about how ejabberd parses the http headers, but you should be fine if you use the unicode module to handle your strings:

Eshell V5.10.4 (abort with ^G) 1> X = unicode:characters_to_binary("विकिपी डिया" ). <<224,164,181,224,164,191,224,164,149,224,164,191,224,164, 170,224,165,128,224,164,161,224,164,191,224,164,175,224, 164,...>> 2> io:format("~ts~n", [X]). विकिपीडिया ok

If you want to do io:format-based debugging, remember to set your format string as "~ts", and not "~s".

Check out more here: http://www.erlang.org/doc/man/unicode.html

Simon Zelazny
  • 386
  • 1
  • 5