-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
Issue
SegyFactory.create_textual_header() throws a UnicodeDecodeError on some EBCDIC characters, even though SegyFile.text_header can already read and print the same header. The two code paths should behave the same way.
Steps to Reproduce
from mdio.segy import SegyFile, SegyFactory, get_segy_standard
segy_path = "gs://tgs-geophysical-test-samples/AP_Data/900_General/WeirdCharinEBCDIC.sgy"
# 1. Read the file
sreader = SegyFile(segy_path) # Works
print(sreader.text_header) # Works (shows weired chars)
factory = SegyFactory(
spec=get_segy_standard(1.0),
samples_per_trace=2001,
sample_interval=4_000,
)
txt = factory.create_textual_header(sreader.text_header) # FailsError:
UnicodeEncodeError: 'ascii' codec can't encode character '\ufffd' in position 475: ordinal not in range(128)
Metadata
Metadata
Assignees
Labels
No labels