Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support to special characters #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,11 @@ def test_qr_library_equivalence(self):

# The two rows from the two libraries should be identical
self.assertEqual(len(micro_row), len(macro_row))

class TestWifiCreation(unittest.TestCase):
def test_render_matrix(self):
micro_qr = MicroQRCode()
ssid, password = 'test', 'test'
micro_qr.add_data('WIFI:S:{};T:WPA;P:{};H:false;;'.format(ssid, password))
matrix = micro_qr.render_matrix()
self.assertGreater(len(matrix), 0)
2 changes: 1 addition & 1 deletion uQR.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ def make_rs_blocks(version, error_correction):
MODE_KANJI: 12,
}

ALPHA_NUM = b'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:'
ALPHA_NUM = b'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:;#&{}[](),=\'"\\'

RE_ALPHA_NUM = re.compile(b'^[' + ALPHA_NUM + b']*')
# The number of bits for numeric delimited data lengths.
Expand Down