         { [ dup 0xd3 = ] [ drop 8 read signed-be> ] }
         { [ dup 0xca = ] [ drop 4 read be> bits>float ] }
         { [ dup 0xcb = ] [ drop 8 read be> bits>double ] }
-        { [ dup 0xe0 mask 0xa0 = ] [ 0x1f mask read ] }
-        { [ dup 0xd9 = ] [ drop read1 read "" like ] }
-        { [ dup 0xda = ] [ drop 2 read be> read "" like ] }
-        { [ dup 0xdb = ] [ drop 4 read be> read "" like ] }
+        { [ dup 0xe0 mask 0xa0 = ] [ 0x1f mask read utf8 decode ] }
+        { [ dup 0xd9 = ] [ drop read1 read utf8 decode ] }
+        { [ dup 0xda = ] [ drop 2 read be> read utf8 decode ] }
+        { [ dup 0xdb = ] [ drop 4 read be> read utf8 decode ] }
         { [ dup 0xc4 = ] [ drop read1 read B{ } like ] }
         { [ dup 0xc5 = ] [ drop 2 read be> read B{ } like ] }
         { [ dup 0xc6 = ] [ drop 4 read be> read B{ } like ] }

        } cond
    ] [
        {
            { [ dup -0x1f >= ] [ 1 >be write ] }
            { [ dup -0x80 >= ] [ 0xd0 write1 1 >be write ] }
            { [ dup -0x8000 >= ] [ 0xd1 write1 2 >be write ] }
            { [ dup -0x80000000 >= ] [ 0xd2 write1 4 >be write ] }
            { [ dup -0x8000000000000000 >= ] [ 0xd3 write1 8 >be write ] }

! Copyright (C) 2013 John Benediktsson
! See http://factorcode.org/license.txt for BSD license

USING: arrays assocs byte-arrays combinators grouping hashtables
io io.binary io.encodings io.encodings.binary
io.encodings.string io.encodings.utf8 io.streams.byte-array
io.streams.string kernel math math.bitwise math.order namespaces
sequences strings ;

IN: msgpack

