Saving run text that contains a lone (unpaired) surrogate throws in TsString normalization

Đang mở
#412 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

@johnml1135 đang làm issue này rồi.

Từ ngày 5/11/2026.

  • #414 của @johnml1135 — đang mở

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
30/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
csharp
Lĩnh vực
backend

Hướng nghiên cứu

Start with TsString.get_NormalizedForm and follow EnumerateSegmentLimits to the char.ConvertToUtf32 call described in the issue. Review the existing TsStringSerializer.GetXmlSafeText handling from #410 and the linked pull request #414. Add a regression test for the provided unpaired-surrogate repro and confirm serialization completes with the chosen normalization and write behavior.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

A run whose text contains an unpaired UTF-16 surrogate cannot be saved: TsString.get_NormalizedForm throws (via EnumerateSegmentLimits → char.ConvertToUtf32) before the serializer runs. Pasted or imported text can carry such characters.

Found while working on #410, which strips unpaired surrogates from string properties (TsStringSerializer.GetXmlSafeText) but cannot reach this path.

Repro: create a TsString with text "a\uD800b" and serialize it with TsStringSerializer.

Suggested fix: make normalization tolerate unpaired surrogates (pass them through or replace with U+FFFD) and strip them on write as #410 does for string properties; add a test.

🤖 Generated with Claude Code

Ngôn ngữ chính
C#
Star
3
Fork
15
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của sillsdev/liblcm

Tất cả issue của sillsdev/liblcm

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.