Skip to content

fix(simplifier): handle OpenCC converters without conversion chains#1184

Open
n19htfall wants to merge 1 commit into
rime:masterfrom
n19htfall:master
Open

fix(simplifier): handle OpenCC converters without conversion chains#1184
n19htfall wants to merge 1 commit into
rime:masterfrom
n19htfall:master

Conversation

@n19htfall

@n19htfall n19htfall commented Jun 29, 2026

Copy link
Copy Markdown

問題

#1185

OpenCC 1.3.2 的 t2s.json 包含 normalization,因此Config::NewFromFile() 會建立 PipelineConverter

PipelineConverter::GetConversionChain() 按設計返回 nullptr,但 simplifier 會直接解引用其結果,導致啟用簡體轉換時發生 SIGSEGV。

修改

  • 集中處理 GetConversionChain() 返回 nullptr 的情況。
  • 正確處理空 conversion list。
  • PipelineConverter 的 ConvertWord() 返回 false,讓Simplifier::Convert() 回退至 ConvertText()
  • ConvertText() 繼續透過 converter_->Convert() 完成轉換。

@felixonmars

Copy link
Copy Markdown

已经应用到 Arch Linux 的 librime 包中,测试有效。谢谢!

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

Successfully merging this pull request may close these issues.

2 participants