6 Replies Latest reply on May 20, 2014 1:51 PM by AhmedMadani

How to Convert to Unicode!?

Title

How to Convert to Unicode!?

Post

Hi there,

I have API to send SMS from sms provider company, if you want to send message you have to convert the text message to Unicode. Can any one help me to know the function that convert the text before send it?

Thank you.

• 1. Re: How to Convert to Unicode!?

Which type of conversion?
Sometthing like this?

THIS IS A SAMPLE

\u0054\u0048\u0049\u0053\u0020\u0049\u0053\u0020\u0041\u0020\u0053\u0041\u004d\u0050\u004c\u0045

or

005400480049005300200049005300200041002000530041004d0050004c0045

• 2. Re: How to Convert to Unicode!?

Thank you raybaudi for ur cooperation,

the example :

chrArray[12] = "ت";

unicodeArray[12] = "062A";

and each letter has different unicode

• 3. Re: How to Convert to Unicode!?

Try this custom function:

/* Unicode ( text ) Custom Function
Author: Daniele Raybaudi
Returns the unicode code of each character of the text.
*/
Case(
Length ( text ) < 10000 ;
Let([
C = Left ( text ; 1 ) ;
M = Mod ( Code ( C ) ; 16^3 ) ;
MM = Mod ( M ; 16^2 ) ;
I = Div ( Code ( C ) ; 16^3 ) ;
II = Div ( M ; 16^2 ) ;
III = Div ( MM ; 16 ) ;
IV = Mod ( MM ; 16 )
] ;
Case(
Length ( text ) ;
Choose ( I ; 0 ; 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 ; "A" ; "B" ; "C" ; "D" ; "E" ; "F" )
&
Choose ( II ; 0 ; 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 ; "A" ; "B" ; "C" ; "D" ; "E" ; "F" )
&
Choose ( III ; 0 ; 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 ; "A" ; "B" ; "C" ; "D" ; "E" ; "F" )
&
Choose ( IV ; 0 ; 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 ; "A" ; "B" ; "C" ; "D" ; "E" ; "F" )
&
Unicode ( Right ( text ; Length ( text ) - 1 ) )
)
) ; "Too many characters"
)

• 4. Re: How to Convert to Unicode!?

You could also try a sample file here:

• 5. Re: How to Convert to Unicode!?

Thank you raybaudi for ur cooperation,

I'll try and reply..

thanks again.

• 6. Re: How to Convert to Unicode!?

I have to thank you raybaudi very much for ur cooperation and I appreciated It's working 100% :)