edit belowFirst of all, I am quite sure this is a duplicated question. But I have no idea how to search for it. I spent quite a long time already.I am reading with python from a .txt file the path to a specific file. i.e./home/username/Documents/K\{u}hnelt.pdfNow, if I try to copy it into another directory using shutil.copyfile(), it says it cannot find it. However, if I write manually/home/username/Documents/Khnelt.pdfit works just fine. I assume it is an encoding issue, but I am not fluent with these things, and I cannot figure it out.I am sorry if there are technical mistakes in the following question, but I don't know how to make it properly. I hope you can understand it correctly.The question is, is there any command in python that interprets the string as it is written in the command line, and converts it into a fully composed type string?I am doing a script in python to copy several .pdf I have in my computer into the current folder. I actually read the pdf location from a .bib file. It is this .bib file which has the location writen in a TeX format.Now, my python script reads the .bib file line by line, and when it findsfile = {:home/user/Documents/K\{u}hnelt\_2003.pdf:pdf},it parses it to keep MyString = home/user/Documents/K\{u}hnelt\_2003.pdfthen I do shutil.copyfile(MyString, NewName.pdf ) which copies the file in the current directory. It works fine, except for files that contain this TeX style. 
Convert TeX accents to UTF-8 in Python
python;character encoding;latex
Consider moving away from the antiquitated, non-Unicode-able BibTeX to the modern Biblatex, with the Unicode-aware Biber.If that isn't an option, use the Bibtexparser library. It contains code to convert from BibTeX-compliant TeX notation to Unicode, with bibtexparser.customization.convert_to_unicode. Building on the example given in the documentation:import bibtexparserwith open(bibtex_file_name) as bibtex_file:    parser = bibtexparser.bparser.BibTexParser()    parser.customization = bibtexparser.cutsomization.convert_to_unicode    bibliography = bibtexparser.load(bibtex_file, parser=parser)    for entry in bibliography.entries:        if entry.has_key('file'):            shutil.copy(entry['file'], )