diff --git a/src/es/pymasde/blueterm/BlueTerm.java b/src/es/pymasde/blueterm/BlueTerm.java
index c0260b4..0f10373 100644
--- a/src/es/pymasde/blueterm/BlueTerm.java
+++ b/src/es/pymasde/blueterm/BlueTerm.java
@@ -783,7 +783,7 @@ interface Screen {
      * @param foreColor the foreground color
      * @param backColor the background color
      */
-    void set(int x, int y, byte b, int foreColor, int backColor);
+    void set(int x, int y, char b, int foreColor, int backColor);
 
     /**
      * Scroll the screen down one line. To scroll the whole screen of a 24 line
@@ -823,7 +823,7 @@ interface Screen {
      * @param foreColor the foreground color
      * @param backColor the background color
      */
-    void blockSet(int sx, int sy, int w, int h, int val, int foreColor, int
+    void blockSet(int sx, int sy, int w, int h, char val, int foreColor, int
             backColor);
 
     /**
@@ -841,6 +841,11 @@ interface Screen {
     void resize(int columns, int rows, int foreColor, int backColor);
 }
 
+class Cell {
+	byte fore, back;
+	char c;
+}
+
 
 /**
  * A TranscriptScreen is a screen that remembers data that's been scrolled. The
@@ -889,7 +894,7 @@ class TranscriptScreen implements Screen {
      * The low byte encodes the ASCII character, the high byte encodes the
      * foreground and background colors, plus underline and bold.
      */
-    private char[] mData;
+    private Cell[] mData;
 
     /**
      * The data's stored as color-encoded chars, but the drawing routines require chars, so we
@@ -927,7 +932,7 @@ class TranscriptScreen implements Screen {
         mActiveRows = screenRows;
         mScreenRows = screenRows;
         int totalSize = columns * totalRows;
-        mData = new char[totalSize];
+        mData = new Cell[totalSize];
         blockSet(0, 0, mColumns, mScreenRows, ' ', foreColor, backColor);
         mRowBuffer = new char[columns];
         mLineWrap = new boolean[totalRows];
@@ -978,12 +983,16 @@ class TranscriptScreen implements Screen {
      * @param foreColor the foreground color
      * @param backColor the background color
      */
-    public void set(int x, int y, byte b, int foreColor, int backColor) {
+    public void set(int x, int y, char b, int foreColor, int backColor) {
         mData[getOffset(x, y)] = encode(b, foreColor, backColor);
     }
 
-    private char encode(int b, int foreColor, int backColor) {
-        return (char) ((foreColor << 12) | (backColor << 8) | b);
+    private Cell encode(char b, int foreColor, int backColor) {
+    	Cell cell = new Cell();
+    	cell.c    = b;
+    	cell.fore = (byte)foreColor;
+    	cell.back = (byte)backColor;
+        return cell;
     }
 
     /**
@@ -1118,13 +1127,13 @@ class TranscriptScreen implements Screen {
      * @param h height
      * @param val value to set.
      */
-    public void blockSet(int sx, int sy, int w, int h, int val,
+    public void blockSet(int sx, int sy, int w, int h, char val,
             int foreColor, int backColor) {
         if (sx < 0 || sx + w > mColumns || sy < 0 || sy + h > mScreenRows) {
             throw new IllegalArgumentException();
         }
-        char[] data = mData;
-        char encodedVal = encode(val, foreColor, backColor);
+        Cell[] data = mData;
+        Cell encodedVal = encode(val, foreColor, backColor);
         for (int y = 0; y < h; y++) {
             int offset = getOffset(sx, sy + y);
             for (int x = 0; x < w; x++) {
@@ -1156,19 +1165,19 @@ class TranscriptScreen implements Screen {
 
         int offset = getOffset(row);
         char[] rowBuffer = mRowBuffer;
-        char[] data = mData;
+        Cell[] data = mData;
         int columns = mColumns;
         int lastColors = 0;
         int lastRunStart = -1;
         final int CURSOR_MASK = 0x10000;
         for (int i = 0; i < columns; i++) {
-            char c = data[offset + i];
-            int colors = (char) (c & 0xff00);
+            char c = data[offset + i].c;
+            int colors = (int) ((data[offset + i].fore << 12) | (data[offset + i].back << 8));
             if (cx == i) {
                 // Set cursor background color:
                 colors |= CURSOR_MASK;
             }
-            rowBuffer[i] = (char) (c & 0x00ff);
+            rowBuffer[i] = c;
             if (colors != lastColors) {
                 if (lastRunStart >= 0) {
                     renderer.drawTextRun(canvas, x, y, lastRunStart, rowBuffer,
@@ -1207,23 +1216,20 @@ class TranscriptScreen implements Screen {
     }
 
     public String getTranscriptText() {
-        return internalGetTranscriptText(true);
+        return internalGetTranscriptText();
     }
 
-    private String internalGetTranscriptText(boolean stripColors) {
+    private String internalGetTranscriptText() {
         StringBuilder builder = new StringBuilder();
         char[] rowBuffer = mRowBuffer;
-        char[] data = mData;
+        Cell[] data = mData;
         int columns = mColumns;
         for (int row = -mActiveTranscriptRows; row < mScreenRows; row++) {
             int offset = getOffset(row);
             int lastPrintingChar = -1;
             for (int column = 0; column < columns; column++) {
-                char c = data[offset + column];
-                if (stripColors) {
-                    c = (char) (c & 0xff);
-                }
-                if ((c & 0xff) != ' ') {
+                char c = data[offset + column].c;
+                if (c != ' ') {
                     lastPrintingChar = column;
                 }
                 rowBuffer[column] = c;
@@ -1342,6 +1348,16 @@ class TerminalEmulator {
      * The current state of the escape sequence state machine.
      */
     private int mEscapeState;
+    
+    /**
+     * True if utf-8 sequence processing is in progress
+     */
+    private boolean mUtfSequence;
+    
+    /**
+     * Codepoint collected from utf-8 characters sequence
+     */
+    private char mCodepoint;
 
     /**
      * Saved state of the cursor row, Used to implement the save/restore cursor
@@ -1510,7 +1526,7 @@ class TerminalEmulator {
             end--;
         }
         for(int i = 0; i <= end; i++) {
-            byte c = (byte) transcriptText.charAt(i);
+            char c = transcriptText.charAt(i);
             if (c == '\n') {
                 setCursorCol(0);
                 doLinefeed();
@@ -1642,7 +1658,7 @@ class TerminalEmulator {
         case 26: // SUB
             if (mEscapeState != ESC_NONE) {
                 mEscapeState = ESC_NONE;
-                emit((byte) 127);
+                emit((char) 127);
             }
             break;
 
@@ -1651,17 +1667,28 @@ class TerminalEmulator {
             startEscapeSequence(ESC);
             break;
 
-        case (byte) 0x9b: // CSI
-            startEscapeSequence(ESC_LEFT_SQUARE_BRACKET);
-            break;
+// this interferes with utf-8 codes
+//        case (byte) 0x9b: // CSI
+//            startEscapeSequence(ESC_LEFT_SQUARE_BRACKET);
+//            break;
 
         default:
             mContinueSequence = false;
             switch (mEscapeState) {
             case ESC_NONE:
-                if (b >= 32) {
-                    emit(b);
-                }
+            	if ( mUtfSequence ) {
+            		if ( (b & 0xc0) == 0x80 )
+            			emit( (char)((mCodepoint << 6) | (b & 0x3f)) );
+
+            		mUtfSequence = false;
+            	}
+            	else if ( (b & 0xe0) == 0xc0 ) {
+            		mCodepoint   = (char)(b & 0x1f);
+            		mUtfSequence = true;
+            	}
+            	else
+            		emit( (char)b );
+
                 break;
 
             case ESC:
@@ -2356,7 +2383,7 @@ class TerminalEmulator {
      *
      * @param b the ASCII character to display.
      */
-    private void emit(byte b) {
+    private void emit(char b) {
         boolean autoWrap = autoWrapEnabled();
 
         if (autoWrap) {
@@ -2413,6 +2440,7 @@ class TerminalEmulator {
         mArgIndex = 0;
         mContinueSequence = false;
         mEscapeState = ESC_NONE;
+        mUtfSequence = false;
         mSavedCursorRow = 0;
         mSavedCursorCol = 0;
         mDecFlags = 0;
