I have a small Python program. I use the the Windows registry to enable the opening of files using the right-click context menu. My registry entry:
C:\Users\me\projects\mynotepad\notepad.exe "%1"
When I try and open a file with a Hebrew name using my right-click context menu, I get the file name as question marks, and I get an exception while trying to get the file size.
Here is my code:
file_name = sys.argv[1]
file_size = os.path.getsize(unicode(file_name))
I have tried this:
file_name = sys.argv[1].decode("cp1255").encode('utf-8')
file_size = os.path.getsize(unicode(file_name))
But it didn't work.
Any advice?