                 break
                 }
                 }
-                if let iKeyString = NSString(bytes: iKey, length: iKeyLength, encoding: String.Encoding.utf8.rawValue) as? String {
+                if let iKeyString = NSString(bytes: iKey, length: iKeyLength, encoding: stringEncoding)?.substring(from: 0) {
                 var iData: UnsafeMutableRawPointer? = nil
                 var iDataLength: Int = 0
                 levelDBIteratorGetValue(iterator, &iData, &iDataLength)

                break
                }
                }
                if let iKeyString = NSString(bytes: iKey, length: iKeyLength, encoding: stringEncoding) as? String {
                if let predicate = predicate {
                var iData: UnsafeMutableRawPointer? = nil
                var iDataLength: Int = 0

                        break
                    }
                }
                if let iKeyString = NSString(bytes: iKey, length: iKeyLength, encoding: stringEncoding)?.substring(from: 0) {
                    let getter : () -> NSObject? = {
                        var iData: UnsafeMutableRawPointer = nil
                        var iDataLength: Int = 0
