Refactor vCard parsing to improve decoding and structure

Replaces regex-based vCard parsing with dedicated functions for parsing lines, handling quoted-printable encoding, and extracting fields. Adds support for CHARSET and ENCODING parameters, improves handling of multi-line and encoded values, and centralizes vCard entry processing for better maintainability and accuracy.
This commit is contained in:
KnugiHK
2025-12-14 23:00:48 +08:00
parent 43658a92c4
commit ddd0ac3143
2 changed files with 120 additions and 29 deletions

View File

@@ -23,7 +23,7 @@ def test_readVCardsFile():
# Test complex name
assert data[1][1] == "Yard Lawn Guy, Jose Lopez"
# Test name with emoji
assert data[2][1] == "John Butler 🌟"
assert data[2][1] == "John Butler 🌟💫🌟"
# Test note with multi-line encoding
assert data[3][1] == "Airline Contact #'s"
# Test address with multi-line encoding