Match <OsString as Debug>::fmt to that of str

819247f1 changed <str as Debug>::fmt such that it does not escape single
quotes, but neglected to apply the same choice to OsString. This commit
does that.
diff --git a/library/core/src/str/lossy.rs b/library/core/src/str/lossy.rs
index 8d4210c..d2dc650 100644
--- a/library/core/src/str/lossy.rs
+++ b/library/core/src/str/lossy.rs
@@ -1,3 +1,4 @@
+use super::char::EscapeDebugExtArgs;
 use super::from_utf8_unchecked;
 use super::validations::utf8_char_width;
 use crate::fmt;
@@ -121,7 +122,11 @@ fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
                 let valid = chunk.valid();
                 let mut from = 0;
                 for (i, c) in valid.char_indices() {
-                    let esc = c.escape_debug();
+                    let esc = c.escape_debug_ext(EscapeDebugExtArgs {
+                        escape_grapheme_extended: true,
+                        escape_single_quote: false,
+                        escape_double_quote: true,
+                    });
                     // If char needs escaping, flush backlog so far and write, else skip
                     if esc.len() != 1 {
                         f.write_str(&valid[from..i])?;
diff --git a/library/core/src/wtf8.rs b/library/core/src/wtf8.rs
index b64fcce..7214918 100644
--- a/library/core/src/wtf8.rs
+++ b/library/core/src/wtf8.rs
@@ -19,7 +19,7 @@
 // implementations, so, we'll have to add more doc(hidden)s anyway
 #![doc(hidden)]
 
-use crate::char::encode_utf16_raw;
+use crate::char::{EscapeDebugExtArgs, encode_utf16_raw};
 use crate::clone::CloneToUninit;
 use crate::fmt::{self, Write};
 use crate::hash::{Hash, Hasher};
@@ -144,14 +144,20 @@ fn as_ref(&self) -> &[u8] {
 impl fmt::Debug for Wtf8 {
     fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
         fn write_str_escaped(f: &mut fmt::Formatter<'_>, s: &str) -> fmt::Result {
-            use crate::fmt::Write;
-            for c in s.chars().flat_map(|c| c.escape_debug()) {
+            use crate::fmt::Write as _;
+            for c in s.chars().flat_map(|c| {
+                c.escape_debug_ext(EscapeDebugExtArgs {
+                    escape_grapheme_extended: true,
+                    escape_single_quote: false,
+                    escape_double_quote: true,
+                })
+            }) {
                 f.write_char(c)?
             }
             Ok(())
         }
 
-        formatter.write_str("\"")?;
+        formatter.write_char('"')?;
         let mut pos = 0;
         while let Some((surrogate_pos, surrogate)) = self.next_surrogate(pos) {
             // SAFETY: next_surrogate provides an index for a range of valid UTF-8 bytes.
@@ -164,7 +170,7 @@ fn write_str_escaped(f: &mut fmt::Formatter<'_>, s: &str) -> fmt::Result {
 
         // SAFETY: after next_surrogate returns None, the remainder is valid UTF-8.
         write_str_escaped(formatter, unsafe { str::from_utf8_unchecked(&self.bytes[pos..]) })?;
-        formatter.write_str("\"")
+        formatter.write_char('"')
     }
 }
 
diff --git a/library/coretests/tests/str_lossy.rs b/library/coretests/tests/str_lossy.rs
index 6e70ea3..820da38 100644
--- a/library/coretests/tests/str_lossy.rs
+++ b/library/coretests/tests/str_lossy.rs
@@ -80,4 +80,5 @@ fn debug() {
             b"Hello\xC0\x80 There\xE6\x83 Goodbye\xf4\x8d\x93\xaa".utf8_chunks().debug(),
         ),
     );
+    assert_eq!("\"'\"", &format!("{:?}", b"'".utf8_chunks().debug()));
 }
diff --git a/library/std/src/ffi/os_str/tests.rs b/library/std/src/ffi/os_str/tests.rs
index 2572b71..3474f0a 100644
--- a/library/std/src/ffi/os_str/tests.rs
+++ b/library/std/src/ffi/os_str/tests.rs
@@ -303,3 +303,9 @@ fn clone_to_uninit() {
     unsafe { a.clone_to_uninit(ptr::from_mut::<OsStr>(&mut b).cast()) };
     assert_eq!(a, &*b);
 }
+
+#[test]
+fn debug() {
+    let s = "'single quotes'";
+    assert_eq!(format!("{:?}", OsStr::new(s)), format!("{:?}", s));
+}