Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

csv utf-8 to iso-8859-1 python

def fix_encoding(text):
    """ force utf-8 encoding """
    encodings = ('iso-8859-15','utf-8','ascii')
    success = False
    for encoding in encodings:
        try:
            utext = text.decode(encoding)
            success = True
            break
        except:
            success = False
    if success:
        return utext.encode('utf-8')
    return text
Source by brainstorm.it #
 
PREVIOUS NEXT
Tagged: #csv #python
ADD COMMENT
Topic
Name
9+6 =