I want to know how can i turn text to US-ASCII in ob2

Hello guys can anyone help me how can i convert text to US-ASCII in ob2 with python because i tried soo many codes from the internet and none of them worked.

def convert_to_ascii(text):
    return text.encode('ascii', errors='ignore').decode()

text_ascii = convert_to_ascii(text)
1 Like