Adding new tests
diff --git a/tests/invalid_characters.rs b/tests/invalid_characters.rs
new file mode 100644
index 0000000..1a9e26a
--- /dev/null
+++ b/tests/invalid_characters.rs
@@ -0,0 +1,35 @@
+extern crate serde;
+
+#[macro_use]
+extern crate serde_jsonrc;
+
+use serde_jsonrc::{Value, Deserializer, Error};
+use serde_jsonrc::de::SliceRead;
+use serde::de::Deserialize;
+
+fn from_slice_with_unicode_substitution(s: &[u8]) -> Result<Value, Error> {
+    let mut de = Deserializer::new(SliceRead::new(s, true));
+    Deserialize::deserialize(&mut de)
+}
+
+#[test]
+fn test_invalid_characters() {
+    let prefix = r#" { "key": "value"#;
+    let suffix = r#"" }"#;
+    let mut s: Vec<u8> = vec![];
+    s.extend(prefix.as_bytes());
+    s.extend(&[0xed, 0xa0, 0x80]);
+    s.extend(suffix.as_bytes());
+    let value = from_slice_with_unicode_substitution(&s).unwrap();
+    assert_eq!(value, json!({"key": "value\u{fffd}\u{fffd}\u{fffd}"}));
+}
+
+#[test]
+fn test_invalid_utf16_escape_sequence() {
+    let s = r#"
+    {
+        "key": "value\ud800"
+    }"#.as_bytes();
+    let value: Value = from_slice_with_unicode_substitution(&s).unwrap();
+    assert_eq!(value, json!({"key": "value\u{fffd}"}));
+}