This commit is contained in:
2026-04-29 14:45:19 +02:00
parent 66b4aa78e8
commit 77625084e9
3 changed files with 254 additions and 9 deletions
+4 -4
View File
@@ -5,14 +5,14 @@ Usage:
import rds_codec # registers the codec
# Decode RDS bytes to str
text = b'\\x48\\x65\\x8A\\x6C\\x6F'.decode('rp-rds')
text = b'\\x48\\x65\\x8A\\x6C\\x6F'.decode('radiodatasystem')
# Encode str to RDS bytes
data = 'Héllo'.encode('rp-rds')
data = 'Héllo'.encode('radiodatasystem')
# With error handlers
text = rds_bytes.decode('rp-rds', errors='replace')
text = rds_bytes.decode('rp-rds', errors='ignore')
text = rds_bytes.decode('radiodatasystem', errors='replace')
text = rds_bytes.decode('radiodatasystem', errors='ignore')
"""
import codecs