This discussion is archived
3 Replies Latest reply: May 27, 2012 10:16 PM by Umer RSS

Unicode Conversion

Umer Journeyer
Currently Being Moderated
Hi all,

I am currently developing an applet for SIM card in which i need to display unicode characters, I mean Urdu language. For example: Entertainment should be displayed like: تفریح
I java it is very simple and i have tried it and it is working fine. But, I am not sure how to do it in java card.
Any suggestions will be appreciated.

  • 1. Re: Unicode Conversion
    Sebastien_Lorquet Journeyer
    Currently Being Moderated
    there are two difficulties here:

    -right to left layout

    for the first one you can find what a phone supports by trying all encodings. I would guess utf-8

    For the second, I have no idea. Maybe the phone text engine will know that these characters must be displayed right to left?

    Maybe it will display that, because it does not know that they must be linked : ت ف ر ی ح

    Maybe it will display the characters, but left to right.

    Anyways firefox always displays these characters from right to left, even if I add spaces or symbols between them, and the textbox editor behaves funny when I select these characters and try to copy-paste them :)
  • 2. Re: Unicode Conversion
    safarmer Expert
    Currently Being Moderated
    You may be over complicating things a little. Given Java Card does not know about strings, you should be able to encode the data in what ever encoding you need when you set the string (either personalisation data or as a hard coded byte array) and when you present the stream of bytes to the phone it should be able to represent it correctly. You would only need to know about the encoding if you want to build a dynamic string from bytes.

  • 3. Re: Unicode Conversion
    Umer Journeyer
    Currently Being Moderated
    Thank you, indeed it is helpful.

    Dear Sabestian thank you to you too : )


  • Correct Answers - 10 points
  • Helpful Answers - 5 points