From f34eea5aa1bcd7182afd3f96b30344e6045f5d7b Mon Sep 17 00:00:00 2001 From: Francis Visoiu Mistrih Date: Tue, 19 Dec 2017 11:51:05 +0000 Subject: [PATCH] [YAML] Always double quote UTF-8 characters llvm-svn: 321068 --- llvm/include/llvm/Support/YAMLTraits.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/llvm/include/llvm/Support/YAMLTraits.h b/llvm/include/llvm/Support/YAMLTraits.h index 83b097a199d6..3ee556d75335 100644 --- a/llvm/include/llvm/Support/YAMLTraits.h +++ b/llvm/include/llvm/Support/YAMLTraits.h @@ -549,9 +549,9 @@ inline QuotingType needsQuotes(StringRef S) { // range. if (C <= 0x1F) return QuotingType::Double; - // C1 control block (0x80 - 0x9F) is excluded from the allowed character - // range. - if (C >= 0x80 && C <= 0x9F) + + // Always double quote UTF-8. + if (C & 0x80 != 0) return QuotingType::Double; // The character is not safe, at least simple quoting needed. -- 2.34.1