         if (!isNil) {
             switch (type) {
             case .tString:
-                encoder.encodeObject(stringData!,forKey:"0")
+                // TODO: add encode to UTF16 support
+                // TODO: use other coder
+                var stringDataUTF8 = stringData!.dataUsingEncoding(NSUTF8StringEncoding)
+                
+                
+                // //println("\(stringDataUTF8!.length)")
+                if stringDataUTF8!.length > maxStingDataLength {
+                    println("TODO: store in text file")
+                } else {
+                    encoder.encodeObject(stringDataUTF8,forKey:"0")
+                }
+                //encoder.encodeObject(stringData!,forKey:"0")
             case .tBool, .tInt, .tDouble:
                 //encoder.encodeBool(numberData!.boolValue, forKey:"0")
                 encoder.encodeObject(numberData!, forKey:"0")

        if (!nilValue) {
            switch (type) {
            case .tString:
                stringData = (decoder.decodeObjectForKey("0") as String)
            case .tBool, .tInt, .tDouble:
            //numberData = NSNumber(bool:decoder.decodeBoolForKey("0"))
                numberData = (decoder.decodeObjectForKey("0") as NSNumber)

    return lhs.uid == rhs.uid
}



public class Property : GraphElement, Coding, Equatable, NSCoding {
    
    let maxStingDataLength = 20
    
    //MARK: Data
    public var type: PropertyType = .tUndefined;
