Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any way to convert a regular string in ActionScript 3 to a ByteArray of Latin-1 Character Codes?

I am having no problem converting a string to a byteArray of UTF-16 encoded characters, but the application I am trying to communicate with (written in Erlang) only understands Latin-1 encoding. Is there any way of producing a byteArray full of Latin-1 character codes from a string within Actionscript 3?

like image 801
Mike Keen Avatar asked Dec 11 '08 18:12

Mike Keen


1 Answers

byteArray.writeMultiByte(string, "iso-8859-1");

http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/utils/ByteArray.html#writeMultiByte()

like image 63
Sean Avatar answered Nov 01 '22 11:11

Sean