任何将ActionScript 3中的常规字符串转换为Latin-1字符代码的ByteArray的方法? [英] Any way to convert a regular string in ActionScript 3 to a ByteArray of Latin-1 Character Codes?

查看:166
本文介绍了任何将ActionScript 3中的常规字符串转换为Latin-1字符代码的ByteArray的方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将字符串转换为UTF-16编码字符的byteArray时,我没有问题,但是我正在尝试与Erlang进行通信的应用程序只能理解Latin-1编码。有没有办法从Actionscript 3中的字符串中产生一个包含Latin-1字符代码的byteArray?

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?

推荐答案

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

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

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

这篇关于任何将ActionScript 3中的常规字符串转换为Latin-1字符代码的ByteArray的方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆