Uncategorized

Encoding and decoding Portuguese word in python in linux envrionment


This is my function to encode and decode the Portuguese word:

def decoded_string(input_string):
    return input_string.encode('utf-8').decode('unicode_escape').encode('latin-1').decode('utf-8')

This is the output in windows: Mario Exportação

But in Linux, it is showing this output: Mario Exportação

Windows is my local machine and Linux is our server machine. I don’t know why it’s not working there and I even added RUN apt-get install -y fonts-dejavu in my docker container to support the Portuguese



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *