Python3 Converting Non-English Chars to English Chars
Question: I have a text file, I read file and after some operation I put these lines
into another file. But input file has some Turkish chars such as
"İ,Ö,Ü,Ş,Ç,Ğ". I want these chars to be converted to English chars because
when I open the files in UTF-8 encoding, these chars are not shown. My code is
below:

    
    
    for i in range (len(singleLine)):
            if singleLine[i] == "İ":
                singleLine.replace(singleLine[i:i+1],"I")
            if singleLine[i] == "Ü":
                singleLine.replace(singleLine[i:i + 1], "U")
            if singleLine[i] == "Ö":
                singleLine.replace(singleLine[i:i + 1], "O")
            if singleLine[i] == "Ç":
                singleLine.replace(singleLine[i:i + 1], "C")
            if singleLine[i] == "Ş":
                singleLine.replace(singleLine[i:i + 1], "S")
            if singleLine[i] == "Ğ":
                singleLine.replace(singleLine[i:i + 1], "G")
        return singleLine
    

But the code does not recognize these Turkish chars in Input file and putting
them into outputfile without any operation.

What is the way to recognize these chars? Is there any special way for ASCII
code based search or something like this ?


Answer: `str` instances are immutable so `str.replace()` does not operate in-place but
instead returns the result.

But [don't do things the hard way](https://pypi.python.org/pypi/Unidecode).

    
    
    >>> import unidecode
    >>> unidecode.unidecode('İ,Ö,Ü,Ş,Ç,Ğ')
    'I,O,U,S,C,G'
    

