Index: clang-tidy/modernize/RawStringLiteralCheck.cpp =================================================================== --- clang-tidy/modernize/RawStringLiteralCheck.cpp +++ clang-tidy/modernize/RawStringLiteralCheck.cpp @@ -65,6 +65,13 @@ 33)) != StringRef::npos) return false; + // Don't replace chars from upper ASCII (>0x7F) as they can represent UTF-8 + // or be supported by specific code pages only. + if (Bytes.find_if([](char C) { + return static_cast(C) > 0x7Fu; + }) != StringRef::npos) + return false; + CharSourceRange CharRange = Lexer::makeFileCharRange( CharSourceRange::getTokenRange(Literal->getSourceRange()), *Result.SourceManager, Result.Context->getLangOpts()); Index: test/clang-tidy/modernize-raw-string-literal.cpp =================================================================== --- test/clang-tidy/modernize-raw-string-literal.cpp +++ test/clang-tidy/modernize-raw-string-literal.cpp @@ -40,6 +40,8 @@ char const *const Us("goink\\\037"); char const *const HexNonPrintable("\\\x03"); char const *const Delete("\\\177"); +char const *const MultibyteSnowman("\xE2\x98\x83"); +// CHECK-FIXES: {{^}}char const *const MultibyteSnowman("\xE2\x98\x83");{{$}} char const *const TrailingSpace("A line \\with space. \n"); char const *const TrailingNewLine("A single \\line.\n");