Error generating qrcode with non ascii character #7

smarro opened this Issue Mar 6, 2012 · 2 comments


None yet

2 participants



with the 2.3 version i get the following error (with 2.0 this didn't happened):

import qrcode
qr_string = u'Acuña'

Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.7/dist-packages/qrcode/", line 12, in make
File "/usr/local/lib/python2.7/dist-packages/qrcode/", line 42, in add_data
data = util.QRData(data)
File "/usr/local/lib/python2.7/dist-packages/qrcode/", line 257, in init
data = str(data)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf1' in position 3: ordinal not in range(128)


PS: Great library!!

Lincoln Loop member

Hi smarro, fixed in 4a60107, bumped to 2.3.1 and uploaded to pypi.

@SmileyChris SmileyChris closed this Mar 6, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment