Skip to main content
Inspiring
January 28, 2011
Question

String to Ascii Code

  • January 28, 2011
  • 1 reply
  • 738 views

Hi!

does anybody wrote a class for convert the special characters in ASCII/ISO Latin-1 Character Code, passing a string?

i need to return for example:

ì --> ì

Help me please!

Thanks!

This topic has been closed for replies.

1 reply

Inspiring
January 28, 2011

Easy:

var str:String="ì"

trace(str.charCodeAt(0));

Or am I missing something here?

Inspiring
January 28, 2011

Hi!

...i need the html code!

thanks to reply me!

Inspiring
January 28, 2011

The code I showed returns 236 and it is easy enough to add the &#

I'm not familiar with all the ins-and-outs of representing all kinds of characters using html codes. But there is also

var str:String="Hello ì"

trace(escape(str));

Which returns Hello%20%EC.

Does that work for your needs?