From 4be0fc082c7d3a03f2b66fa4ffb9dbfb3d606478 Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Sat, 1 Oct 2022 20:25:36 +0200 Subject: Fix handling of UCS-1 encoded strings Add test to python/demo.py --- python/demo.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'python') diff --git a/python/demo.py b/python/demo.py index e57af05a..1230e005 100755 --- a/python/demo.py +++ b/python/demo.py @@ -58,6 +58,9 @@ usd = comms.find_or_create('$') eur = comms.find_or_create('EUR') xcd = comms.find_or_create('XCD') +# Tests currency symbols encoded with UCS-1. For details see #2132. +xxx = comms.find_or_create('¤') + assert not comms.find('CAD') assert not comms.has_key('CAD') assert not 'CAD' in comms @@ -79,7 +82,7 @@ comms.european_by_default = True # don't need to worry about them, but they'll show up if you examine all the # keys in the commodities dict. -assertEqual([u'', u'$', u'%', u'EUR', u'XCD', u'h', u'm', u's'], +assertEqual([u'', u'$', u'%', u'EUR', u'XCD', u'h', u'm', u's', u'¤'], sorted(comms.keys())) # All the styles of dict iteration are supported: -- cgit v1.2.3