Cannot copy worksheets with non-ascii titles

Issue #773 resolved
eson created an issue
Traceback (most recent call last):
  File "", line 236, in <module>
    CopySheet(wb,sn, "12")
  File "", line 168, in CopySheet
    s = wb.copy_worksheet(ws)
  File "/usr/lib/python2.7/site-packages/openpyxl/workbook/", line 364, in copy_worksheet
    new_title = "{0} Copy".format(from_worksheet.title)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 3-4: ordinal not in range(128)

"{0} Copy".format(from_worksheet.title) replace with u"{0} Copy".format(from_worksheet.title) 
that is working well

Comments (3)

  1. Log in to comment