Fix writing of strings containing only emojis