Unicode Strings

Options
mbustos
edited January 2011 in Native
Hi, the chat events in my game I was using EG_STRING and then casting to JString, but now I need to send UTF16 text and it seems that JString only returns "char *".

How could I do that?

Thanks!

Comments

  • Kaiserludi
    Options
    Hi mbustos.
    At the moment the Photon native Clients only support ANSI in their API, not Unicode. If all the non-ASCII letters, which you need, are belonging to the other half of ANSI, you could just convert them to ANSI and then pass them to Photon.
    You can use these C functions
    EG_CHAR* ANSI2Unicode(char *_str, EG_CHAR *_wstr, int _wstrSize);
    char* Unicode2ANSI(const EG_CHAR *_wstr, char *_str, int _strSize);
    char* Unicode2UTF8(const EG_CHAR *wstr, int src_len, unsigned char *dst, int dst_size);
    EG_CHAR* UTF82Unicode(const unsigned char* str, int src_len, EG_CHAR* dst, int dst_size);
    from the Common C API in the Photon Client SDK for the conversions.

    If you do need some non-ANSI letters, then there is currently no support for them in the client API.

    We will discuss internally, if and when we can add this feature, now that we have someone, actually needing it (it has been very low priority on our todo list in the past, as no one has ever asked for it until now).
  • Kaiserludi
    Options
    Hi again.
    We will definitely support unicode in the future, the work on according code changes has already started, but I can't tell a release date for the unicode support, yet.
  • Kaiserludi
    Options
    Hi again. The new version 6.4.0, the first release with full unicode support, is now available for download.