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

醉酒当歌 提交于 2019-12-10 13:12:15

问题


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?


回答1:


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

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



来源:https://stackoverflow.com/questions/360353/any-way-to-convert-a-regular-string-in-actionscript-3-to-a-bytearray-of-latin-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!