From b0006648e2f58de77f261c5660cb74e2beccbbe9 Mon Sep 17 00:00:00 2001 From: empyrical Date: Sun, 19 Apr 2020 12:57:32 -0700 Subject: [PATCH] Fabric: Add Unicode prefix to AttachmentCharacter (#28617) Summary: This pull request adds a Unicode `u8` prefix to the string literal returned in `AttributedString.cpp`'s `Fragment::AttachmentCharacter()`. This fixes the following error when building on MSVC: ``` react\attributedstring\AttributedString.cpp(21): error C4566: character represented by universal-character-name '\uFFFC' cannot be represented in the current code page (1252) ``` ## Changelog [Internal] [Fixed] - Fabric: Add Unicode prefix to AttachmentCharacter Pull Request resolved: https://github.com/facebook/react-native/pull/28617 Test Plan: The Fabric test suite has been ran on a Clang-based build of Fabric on macOS, and no regressions in it have been noted. Differential Revision: D21118078 Pulled By: shergin fbshipit-source-id: c105de5e4edb67fed97ce44153a75d9d380bf588 --- ReactCommon/fabric/attributedstring/AttributedString.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReactCommon/fabric/attributedstring/AttributedString.cpp b/ReactCommon/fabric/attributedstring/AttributedString.cpp index 7d872e65e9c..57120d063c4 100644 --- a/ReactCommon/fabric/attributedstring/AttributedString.cpp +++ b/ReactCommon/fabric/attributedstring/AttributedString.cpp @@ -18,7 +18,7 @@ using Fragments = AttributedString::Fragments; #pragma mark - Fragment std::string Fragment::AttachmentCharacter() { - return "\uFFFC"; // Unicode `OBJECT REPLACEMENT CHARACTER` + return u8"\uFFFC"; // Unicode `OBJECT REPLACEMENT CHARACTER` } bool Fragment::isAttachment() const {