We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1de1739 commit c5b3cb5Copy full SHA for c5b3cb5
library/std/src/sys_common/wtf8.rs
@@ -383,7 +383,7 @@ impl Wtf8Buf {
383
_ => {
384
// If we'll be pushing a string containing a surrogate, we may
385
// no longer have UTF-8.
386
- if other.next_surrogate(0).is_some() {
+ if self.is_known_utf8 && other.next_surrogate(0).is_some() {
387
self.is_known_utf8 = false;
388
}
389
0 commit comments