text_plain_output_1.png
import tensorflow as tf

tf.constant(u'Thanks 😊')

tf.constant([u"You're", u'welcome!']).shape

text_utf8 = tf.constant(u'语言处理')
text_utf8

text_utf16be = tf.constant(u'语言处理'.encode('UTF-16-BE'))
text_utf16be

text_chars = tf.constant([ord(char) for char in u'语言处理'])
text_chars

tf.strings.unicode_decode(text_utf8, input_encoding='UTF-8')

tf.strings.unicode_encode(text_chars, output_encoding='UTF-8')

tf.strings.unicode_transcode(text_utf8, input_encoding='UTF8', output_encoding='UTF-16-BE')

batch_utf8 = [s.encode('UTF-8') for s in [u'hÃllo', u'What is the weather tomorrow', u'Göödnight', u'😊']]
batch_chars_ragged = tf.strings.unicode_decode(batch_utf8, input_encoding='UTF-8')

tf.strings.unicode_encode([[99, 97, 116], [100, 111, 103], [99, 111, 119]], output_encoding='UTF-8')