When inserting a non-BMP character (i.e. characters with a Unicode codepoint above U+FFFF), the content gets corrupted after reading it from a view. At every instance of such characters, there is an exta U+FFFD REPLACEMENT CHARACTER inserted into the text.
To reproduce, use the following commands.
Create the document containing a field with the character U+1F604 SMILING FACE WITH OPEN MOUTH AND SMILING EYES:
Get the document to ensure that it was saved properly:
Create a view that will return that document:
Get the document from the view:
Now we can see that the field value now contains two characters. The original character as well as U+FFFD.