Skip to content

Commit

Permalink
Add missing GSM 03.38 symbols for decoding
Browse files Browse the repository at this point in the history
In addition:

* Re-order several symbols by codepoint
  • Loading branch information
kurtmckee authored and LudovicRousseau committed Sep 25, 2024
1 parent 79edcba commit ee8512c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
3 changes: 2 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Unreleased changes
==================
* Remove Python 2 conditional code
* Migrate a `src/` layout.
* Migrate a `src/` layout
* Add missing GSM 03.38 symbols for decoding
* Support only Python 3.9 and higher
* Remove the Python 2.x-only Pyro dependency
* Migrate CI to use the official Coveralls action
Expand Down
28 changes: 24 additions & 4 deletions src/smartcard/util/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,18 @@ def toBytes(bytestring):
'\r': 0x0D, # CR Carriage Return
'Å': 0x0E, # Å Angstroem majuscule
'å': 0x0F, # å Angstroem minuscule
'Δ': 0x10, # Δ Greek letter delta
'_': 0x11, # underscore
'Φ': 0x12, # Φ Greek letter phi
'Γ': 0x13, # Γ Greek letter gamma
'Λ': 0x14, # Λ Greek letter lambda
'Ω': 0x15, # Ω Greek letter omega
'Π': 0x16, # Π Greek letter pi
'Ψ': 0x17, # Ψ Greek letter psi
'Σ': 0x18, # Σ Greek letter sigma
'Θ': 0x19, # Θ Greek letter theta
'Ξ': 0x1A, # Ξ Greek letter xi
# 0x1B maps to extension table
'Æ': 0x1C, # Æ majuscule ae
'æ': 0x1D, # æ minuscule ae
'ß': 0x1E, # ß s dur allemand
Expand All @@ -141,17 +152,26 @@ def toBytes(bytestring):
'"': 0x22, # guillemet
'#': 0x23,
'¤': 0x24, # ¤ carré
#
# 0x25 ... 0x3F # % ... ?
#
'¡': 0x40, # ¡ point d'exclamation renversé
#
# 0x41 ... 0x5A # A ... Z
#
'Ä': 0x5B, # Ä majuscule A trema
'ä': 0x7B, # ä minuscule a trema
'Ö': 0x5C, # Ö majuscule O trema
'ö': 0x7C, # ö minuscule o trema
'Ñ': 0x5D, # Ñ majuscule N tilde espagnol
'ñ': 0x7D, # ñ minuscule n tilde espagnol
'Ü': 0x5E, # Ü majuscule U trema
'ü': 0x7E, # ü minuscule u trema
'§': 0x5F, # § signe paragraphe
'¿': 0x60, # ¿ point interrogation renversé
#
# 0x61 ... 0x7A # a ... z
#
'ä': 0x7B, # ä minuscule a trema
'ö': 0x7C, # ö minuscule o trema
'ñ': 0x7D, # ñ minuscule n tilde espagnol
'ü': 0x7E, # ü minuscule u trema
'à': 0x7F, # à a accent grave
}

Expand Down

0 comments on commit ee8512c

Please sign in to comment.