-- Run in a database with collation Latin1_General_100_CI_AS_SC_UTF8
-- two-byte character followed by a four-byte character
DECLARE @y nvarchar(max) = N'X😎';
-- Bug: split character converting to four bytes of storage
SELECT CONVERT(nvarchar(2), @y);
-- RIGHT(...,1) has a LEN of 2
SELECT LEN(RIGHT(CONVERT(nvarchar(2), @y), 1));
-- Works: returns 'X'
SELECT CONVERT(nvarchar(2), CONVERT(nvarchar(4000), @y, 2));