You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public constant notValid = hex"F09FA684";
Solidity throws the following error:
Type literal_string (contains invalid UTF-8 sequence at position 3) is not implicitly convertible to
expected type string memory.
However, given the valid series of UTF-8 encoded bytes \xF0\x9F\xA6\x84, Solidity should decode it to get the unicorn emoji: 🦄, a valid UTF-8 decoded character.
You can verify the desired behavior here,
entering \xF0\x9F\xA6\x84 into the UTF-8-encoded box.
This issue was discovered as the result of a StackExchange question, which you can find here .
Solidity 0.4.11
Related Files:
/libdevcore/UTF8.cpp [1071] - where error is thrown
/libsolidity/ast/Types.cpp [31] - validateUTF8() improperly returns false
OS: Ubuntu 16.04
The text was updated successfully, but these errors were encountered:
Given the following raw hex string:
public constant notValid = hex"F09FA684";
Solidity throws the following error:
However, given the valid series of UTF-8 encoded bytes
\xF0\x9F\xA6\x84
, Solidity should decode it to get the unicorn emoji: 🦄, a valid UTF-8 decoded character.You can verify the desired behavior here,
entering \xF0\x9F\xA6\x84 into the UTF-8-encoded box.
This issue was discovered as the result of a StackExchange question, which you can find here .
Solidity 0.4.11
Related Files:
/libdevcore/UTF8.cpp [1071] - where error is thrown
/libsolidity/ast/Types.cpp [31] - validateUTF8() improperly returns false
OS: Ubuntu 16.04
The text was updated successfully, but these errors were encountered: