Skip to content

Conversion engines ​

RustZ has two engines for Traditional ⇄ Simplified conversion. Switch between them in Settings → Default conversion, or with /e:opencc and /e:convertz on the command line.

How the two engines work

The custom dictionary comes first ​

Whichever engine you use, text is first matched against your custom dictionary — left to right, longest entry first. Matched words are written as they are; only the rest goes to the engine.

The OpenCC engine ​

The default engine uses the dictionaries from OpenCC 1.4.2 and converts the way OpenCC does:

  1. Segmentation: the text is split into segments by longest-phrase matching (STPhrases, 49,269 phrases, for Simplified → Traditional).
  2. Conversion chain: each segment passes through one or more dictionary groups; each group tries phrases first, then single characters.
DirectionGlyph standardChain
S → TOpenCC standardphrases + characters
S → TTaiwanphrases + characters → Taiwan glyphs (裏 → 裡, 着 → 著…)
S → TTaiwan + vocabularyphrases + characters → Taiwan vocabulary and glyphs (软件 → 軟體)
S → THong Kongphrases + characters → Hong Kong glyphs
T → STaiwan (+ vocabulary)undo Taiwan glyphs (and vocabulary) → phrases + characters
T → SHong Kongundo Hong Kong glyphs → phrases + characters
T → SOpenCC standardphrases + characters

For Traditional → Simplified, the glyph standard describes how the source text is written.

Examples:

InputOpenCC standardTaiwanTaiwan + vocabulary
头发很长,发展很快頭髮很長,發展很快頭髮很長,發展很快頭髮很長,發展很快
里面的软件裏面的軟件裡面的軟件裡面的軟體
内存和鼠标內存和鼠標內存和鼠標記憶體和滑鼠

The ConvertZ engine ​

This engine uses ConvertZ 8.02's data and converts the way ConvertZ did:

  1. Character by character: 2,293 characters for Simplified → Traditional and 2,472 for Traditional → Simplified, taken from the GBK ↔ Big5 table built into ConCmd.
  2. Fix lists: longest-match replacement on the converted text. The Traditional list has 7,576 rules and the Simplified list 2,879, from ConvertZ 8.02's built-in BI_TradFix.dat and BI_SimFix.dat.

The fix list matches the converted text, scans it once, and after a match continues right after the matched word. The example from ConCmd's manual:

Fix listBefore (after per-character conversion)After
明了,明瞭已經天明了。眾人明了他的處境。已經天明瞭。眾人明瞭他的處境。 (the first one is wrong)
plus 天明,天明same已經天明了。眾人明瞭他的處境。

An entry that "converts to itself" blocks a wrong fix — a trick the original fix lists use a lot, and RustZ keeps that behaviour.

Turn off 套用 ConvertZ 詞彙修正表 (Apply ConvertZ fix lists) for character-by-character conversion only.

Which one to use ​

SituationSuggestion
Simplified → Traditional as written in TaiwanOpenCC, with Taiwan vocabulary on
Change the script only, keep the vocabularyOpenCC, with Taiwan vocabulary off
Hong Kong usageOpenCC, glyph standard Hong Kong
Output identical to ConvertZConvertZ

How "Auto" decides ​

With the script set to Auto (no /f: on the command line), RustZ converts only when needed:

  • Writing Big5: Simplified → Traditional only when the source is not Big5 and the text has more Simplified-only characters (simplified forms that Big5 lacks) than Traditional-only ones (traditional forms that GB2312 lacks). A Traditional UTF-8 file written as Big5 is not "converted again".
  • Writing GBK or HZ: Traditional → Simplified when the source is Big5 or the text has more Traditional-only characters.
  • Anything else: the script is kept.

Choosing Traditional or Simplified always converts — except that a Big5 source is never converted to Traditional (it already is), and Simplified is ignored when writing Big5.

Tables derived from ConvertZ are for personal, non-commercial use. OpenCC dictionaries are Apache-2.0.