             try assertDecoding(db, sql, Int32.self, expectedSQLiteConversion: 0, expectedDatabaseValueConversion: nil)
             try assertDecoding(db, sql, Int64.self, expectedSQLiteConversion: 0, expectedDatabaseValueConversion: nil)
             try assertDecoding(db, sql, Double.self, expectedSQLiteConversion: 0, expectedDatabaseValueConversion: nil)
-            try assertDecoding(db, sql, String.self, expectedSQLiteConversion: "'fooéı👨👨🏿🇫🇷🇨🇮'", expectedDatabaseValueConversion: "'fooéı👨👨🏿🇫🇷🇨🇮'")
-            try assertDecoding(db, sql, Data.self, expectedSQLiteConversion: "'fooéı👨👨🏿🇫🇷🇨🇮'".data(using: .utf8), expectedDatabaseValueConversion: "'fooéı👨👨🏿🇫🇷🇨🇮'".data(using: .utf8))
+            try assertDecoding(db, sql, String.self, expectedSQLiteConversion: emojiString, expectedDatabaseValueConversion: emojiString)
+            try assertDecoding(db, sql, Data.self, expectedSQLiteConversion: emojiData, expectedDatabaseValueConversion: emojiData)
+            return .rollback
+        }
+        
+        // nonUTF8Data is turned to Blob
+        
+        try dbQueue.inTransaction { db in
+            try db.execute("INSERT INTO `values` (\(columnName)) VALUES (?)", arguments: [nonUTF8Data])
+            let sql = "SELECT \(columnName) FROM `values`"
+            XCTAssertEqual(try DatabaseValue.fetchOne(db, sql)!.storageClass, .blob)
+            try assertDecoding(db, sql, Bool.self, expectedSQLiteConversion: false, expectedDatabaseValueConversion: nil)
+            try assertDecoding(db, sql, Int.self, expectedSQLiteConversion:0, expectedDatabaseValueConversion: nil)
+            try assertDecoding(db, sql, Int32.self, expectedSQLiteConversion: 0, expectedDatabaseValueConversion: nil)
+            try assertDecoding(db, sql, Int64.self, expectedSQLiteConversion: 0, expectedDatabaseValueConversion: nil)
+            try assertDecoding(db, sql, Double.self, expectedSQLiteConversion: 0, expectedDatabaseValueConversion: nil)
+//            try assertDecoding(db, sql, String.self, expectedSQLiteConversion: nil, expectedDatabaseValueConversion: nil)
+            try assertDecoding(db, sql, Data.self, expectedSQLiteConversion: nonUTF8Data, expectedDatabaseValueConversion: nonUTF8Data)
             return .rollback
         }
     }

            try assertDecoding(db, sql, Int32.self, expectedSQLiteConversion: 0, expectedDatabaseValueConversion: nil)
            try assertDecoding(db, sql, Int64.self, expectedSQLiteConversion: 0, expectedDatabaseValueConversion: nil)
            try assertDecoding(db, sql, Double.self, expectedSQLiteConversion: 0, expectedDatabaseValueConversion: nil)
            try assertDecoding(db, sql, String.self, expectedSQLiteConversion: "'fooéı👨👨🏿🇫🇷🇨🇮'", expectedDatabaseValueConversion: "'fooéı👨👨🏿🇫🇷🇨🇮'")
            try assertDecoding(db, sql, Data.self, expectedSQLiteConversion: "'fooéı👨👨🏿🇫🇷🇨🇮'".data(using: .utf8), expectedDatabaseValueConversion: "'fooéı👨👨🏿🇫🇷🇨🇮'".data(using: .utf8))
            return .rollback
        }
    }

            try assertDecoding(db, sql, Int32.self, expectedSQLiteConversion: 0, expectedDatabaseValueConversion: nil)
            try assertDecoding(db, sql, Int64.self, expectedSQLiteConversion: 0, expectedDatabaseValueConversion: nil)
            try assertDecoding(db, sql, Double.self, expectedSQLiteConversion: 0, expectedDatabaseValueConversion: nil)
            try assertDecoding(db, sql, String.self, expectedSQLiteConversion: emojiString, expectedDatabaseValueConversion: emojiString)
            try assertDecoding(db, sql, Data.self, expectedSQLiteConversion: emojiData, expectedDatabaseValueConversion: emojiData)
            return .rollback
        }
        
        // emojiData is turned to Blob
        
        try dbQueue.inTransaction { db in
            try db.execute("INSERT INTO `values` (noneAffinity) VALUES (?)", arguments: [emojiData])
            let sql = "SELECT noneAffinity FROM `values`"
            XCTAssertEqual(try DatabaseValue.fetchOne(db, sql)!.storageClass, .blob)
            try assertDecoding(db, sql, Bool.self, expectedSQLiteConversion: false, expectedDatabaseValueConversion: nil)
