Python文字列encode
isalnum

encode文字列

append

指定したエンコーディングで bytes オブジェクトを返します。

構文

str.encode(encoding, errors?)

使用例

下記の値を入力するとサンプルに即時反映されます。

encoded
encode
print
text = "안녕"
encoded = text.encode("utf-8")
print(encoded)  # b'\xec\x95\x88\xeb\x85\x95'
print(encoded.decode("utf-8"))  # 안녕