isalnum
encode
append
指定したエンコーディングで bytes オブジェクトを返します。
str.encode(encoding, errors?)
下記の値を入力するとサンプルに即時反映されます。
encoded
print
text = "안녕" encoded = text.encode("utf-8") print(encoded) # b'\xec\x95\x88\xeb\x85\x95' print(encoded.decode("utf-8")) # 안녕