utf-8 questions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 1/15/08, Ryan Li <lxinyi at gmail.com> wrote:
>
> Dear Pjsip Fellows,
>
> I am new to this project.
> Pjsip documentation does not mention how to support unicode directly.
> In order to send unicode messages, for example, instant message by using
> pjsua_im_send, what should I do? Should convert the unicode to utf-8 string
> manually before invoking the function?


pjsip, including pjsua-lib, should allow Unicode message body, thanks to
pj_str_t which allows null character to appear in the string, so no
conversion to UTF-8 should be required by pjsip. I suppose you could do this
to send Unicode IM or any other binary content, but I have not tried this
myself:

  pj_str_t content_type, content;

  content_type = pj_str("whatever");
  content.ptr = ... pointer to binary data;
  content.length = ... length of binary data;

  status = pjsua_im_send(acc_id, to_uri, &content_type, content, NULL);


In fact, it would be great if someone can indicate how utf-8 is support in
> the entire pjsip.


SIP is UTF-8 based protocol, and since UTF-8 is encoding friendly to the
good old C null-terminated string, there's nothing special in pjsip to
handle this.

SIP may contain binary message body, and this is also fine with pjsip since
pjsip does not generally process the message body, except SDP and PIDF/XML,
which are normally encoded in UTF-8 anyway.

pjsip itself always works in ANSI mode even on systems where the native
encoding is Unicode (such as WinCE or Symbian). Confused? ;-)

 -benny



Thanks a lot!
> Ryan Li
>
> _______________________________________________
> Visit our blog: http://blog.pjsip.org
>
> pjsip mailing list
> pjsip at lists.pjsip.org
> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20080115/4f5a811b/attachment.html 


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux