/*
 ** 2013 July 01
 **
 ** The author disclaims copyright to this source code.  In place of
 ** a legal notice, here is a blessing:
 **    May you do good and not evil.
 **    May you find forgiveness for yourself and forgive others.
 **    May you share freely, never taking more than you give.
 */
package info.ata4.unity.cli.extract;

import info.ata4.unity.serdes.UnityObject;
import java.io.IOException;

/**
 *
 * @author Nico Bergemann <barracuda415 at yahoo.de>
 */
public class TextAssetHandler extends AssetExtractHandler {
    
    public TextAssetHandler(String ext) {
        setOutputFileExtension(ext);
    }

    @Override
    public void extract(UnityObject obj) throws IOException {
        String name = obj.getValue("m_Name");
        String script = obj.getValue("m_Script");
        
        setOutputFileName(name);
        writeData(script.getBytes("UTF8"));
    }
}

@@ -375,16 +375,59 @@
 Object;%0A
+import info.ata4.unity.serdes.UnityString;%0A
 import j
@@ -788,24 +788,29 @@
 %22);%0A        
+Unity
 String scrip
@@ -836,16 +836,23 @@
 _Script%22
+, false
 );%0A     
@@ -920,20 +920,12 @@
 .get
-Bytes(%22UTF8%22
+Raw(
 ));%0A

Write strings directly and don't convert them to UTF-8