Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Dictionary writes UNICODE but does not read correctly.

未关闭
#124 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
c
领域
data

调研方向

从所引用的 SimpleITK issue 以及读取和写入元数据字符串的 MetaIO 代码开始。使用示例 header 重现不匹配,尤其是 test1 和 test2 的值,然后验证写入和读取相同的 Unicode 元数据是否能保留原始字符串。

由索引模型根据 Issue 内容生成。

描述

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
主要语言
C
星标
32
派生
26
平均合并
2 小时 40 分钟
30 天内合并 PR
4

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Kitware/MetaIO 的其他 Issue

查看 Kitware/MetaIO 的全部 Issue

相似的 Issue

更多 C Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。