lincolnloop/python-qrcode — Issue #7: Error generating qrcode with non ascii character
Author: smarro
Created: 2012-03-06 20:26:28+00:00
State: open

Hi,

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

import qrcode
qr_string = u'Acuña'
qrcode.make(qr_string)

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

Thanks

PS: Great library!!