---
title: "[心得] 把纯文本嵌入as3类中"
author: "cloud21"
date: "2011-06-27T11:07:29Z"
tags: []
categories: ["Web前端"]
slug: "as3"
draft: false
lastmod: "2011-06-27T11:07:29Z"
id: 1106205
url: "https://cloud21.iteye.com/blog/1106205"
---

```java
必须知道文本的编码类型, 否则中文会读出乱码 

[embed(source = 'test.txt',mimeType="application/octet-stream")] 
private var CLS_txt:Class 

var txt:ByteArray = new CLS_txt 
trace(txt.readMultiByte(txt.length,'utf-8'))
```