ksobon / Bumblebee

Excel interop for Dynamo
36 stars 14 forks source link

use of unicode characters in filePath #14

Closed ksobon closed 8 years ago

ksobon commented 8 years ago

opening file will fail when file path contains unicode characters (apostrophe stuff common in non-english languages).

ksobon commented 8 years ago

it seems like standard encoding is set to UTF-8 and that is not exactly compatible with unicode characters that some of the international users might be using in their file names. Updating file path formatting to unicode() seems to have fixed the issue:

if filePath == None:
            # run excel in live mode
            xlApp = LiveStream()
            live = True
        else:
            # run excel from file on disk
            xlApp = SetUp(Excel.ApplicationClass())
            if os.path.isfile(unicode(filePath)):
                xlApp.Workbooks.open(unicode(filePath))
            live = False