Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dictionary writes UNICODE but does not read correctly. #124

Open
blowekamp opened this issue Mar 26, 2024 · 0 comments
Open

Dictionary writes UNICODE but does not read correctly. #124

blowekamp opened this issue Mar 26, 2024 · 0 comments

Comments

@blowekamp
Copy link
Collaborator

This issue is first reported here: SimpleITK/SimpleITK#2082

It appears that MetaIO does not sanitize the input to write from UNICODE, and can write some UNICODE strings. However, MetaIO is not able to read the same UNICODE string it has written.

Example output from above:

Expected equality of these values:
  img2.GetMetaData("test2")
    Which is: "des caract\xC3\xA8res sp\xC3\xA9" "ci"
    As Text: "des caractères spéci"
  value2
    Which is: "des caract\xC3\xA8res sp\xC3\xA9" "ci\xC3\xB6"
    As Text: "des caractères spéciö"

The Sample header file:

ObjectType = Image
NDims = 3
BinaryData = True
BinaryDataByteOrderMSB = False
CompressedData = False
TransformMatrix = 1 0 0 0 1 0 0 0 1
Offset = 0 0 0
CenterOfRotation = 0 0 0
AnatomicalOrientation = RAI
ElementSpacing = 1 1 1
test1 = des caractères spéciaux
test2 = des caractères spéciö
DimSize = 2 2 2
ElementType = MET_DOUBLE
ElementDataFile = LOCAL
@blowekamp blowekamp changed the title Dictionary write UNICODE but is does not read. Dictionary writes UNICODE but does not read correctly. Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant