I have created a small tool using Tkinter that enters a string using entry widget , search for that string in multiple files and displays the list of file names that contains that string in listbox. All the files are utf-8 encoded already. Now the problem is, when I run my code from IDE(Pycharm), and input search string that contains a utf-8 character in the tool UI, it works fine and searched all files that contains it.
But if I create a exe file of that code(using py2exe), and launch the tool , enter the same string, it cannot search and code continues to search non-stop.(With non- utf-8 characters, it works fine)
In the application code, I have 'imported codecs' and opened file using command codecs.open(SourceFile, encoding ='utf-8')
Please help me to solve this problem that how exe file can also work correct and search strings successfully.