I\'ve been trying to output as \'\\U0001f604\' instead of the smiley but it doesn\'t seem to work.
i tried
If this is for debugging purposes, you could use %r as the format specifier.
>>> print '%r' % u'\U0001f604' u'\U0001f604'