Skip to content

Commit

Permalink
Fabric: Add Unicode prefix to AttachmentCharacter (#28617)
Browse files Browse the repository at this point in the history
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: #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
  • Loading branch information
empyrical authored and facebook-github-bot committed Apr 19, 2020
1 parent de188a2 commit b000664
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ReactCommon/fabric/attributedstring/AttributedString.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit b000664

Please sign in to comment.