【发布时间】:2012-05-19 16:24:48
【问题描述】:
我想以 utf-8 编码格式保存文件(不是没有 BOM 的 utf-8)。 Adobe Charset 支持页面上没有明确的信息
(http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/charset-codes.html)
我想将文件保存为带有 csv 扩展名的 utf-8 格式。我尝试了以下方法,但我得到了我想要的:
byte.writeMultiBytes(fileContent,"utf-8");
我也试过了,
unicode-1-1-utf-8, unicode-2-0-utf-8, x-unicode-2-0-utf-8.
我也尝试了其他方法,但仍然没有得到所需的编码格式:
writeUTF(var:String) writeByte(var:String)
这是我现在拥有的,
var fileReference:FileReference = new FileReference();
var bytes:ByteArray = new ByteArray();
// SAVING file in utf-8 encoding format.
bytes.writeUTFBytes(this.fileContents);
fileReference.save(bytes, "PluginLog.csv");
closePopup(null);
【问题讨论】:
-
我在这里找到了我的问题的答案:stackoverflow.com/questions/4192186/…
标签: apache-flex utf-8 character-encoding byte-order-mark