繁體中文 | 日本語 | 한국어 | 简体中文 | English
IME garbled text recovery for Traditional Chinese (Bopomofo / Zhuyin).
Typed the right keys but forgot to switch your input method? You get gibberish like su3cl3 instead of 你好. Migao converts it back — instantly, in-place, without retyping.
Type: su3cl3
Select: Ctrl+A
Fix: Ctrl+Alt+R
Result: 你好
irm https://raw.githubusercontent.com/winterdrive/migao/main/install.ps1 | iexInstalls both migao (CLI) and migao-watch (background daemon), adds them to PATH, creates a Start Menu shortcut, and optionally registers migao-watch to run on login.
To uninstall:
& ([scriptblock]::Create((irm https://raw.githubusercontent.com/winterdrive/migao/main/install.ps1))) -Uninstallcargo install migaogit clone https://github.com/winterdrive/migao.git
cd Migao
cargo build --release
# binaries: target/release/migao target/release/migao-watchmigao-watch runs silently in the system tray and fixes garbled text anywhere on Windows with a single hotkey.
macOS / Linux:
migao-watchis not yet available on non-Windows platforms. Contributions are welcome — open an Issue to discuss or claim the work. In the meantime, two alternatives exist:
- CLI pipe:
pbpaste | migao fix | pbcopy(macOS) orxclip -o | migao fix | xclip -i(Linux)- AI agent: IDEs with skill support (Claude Code, Cursor, etc.) can call
migao fixdirectly — seeskills/migao/SKILL.md
- Launch Migao Watch from Start Menu, or let it start at login.
- Type normally. If you forgot to switch IME and produced garbled text, select it. In many editors, Ctrl+A selects the whole field.
- Press Ctrl+Alt+R. The selected text is replaced with the correct Chinese text in-place.
- Press Ctrl+Alt+R again within 3 seconds to cycle through alternative candidates.
Manual launch does not require keeping a terminal window open.
A pixel-art rice cake appears in the taskbar notification area:
| Icon | Meaning |
|---|---|
| Coloured | Active — hotkey listening |
| Grey | Paused — hotkey suspended |
Right-click for the context menu:
- Pause / Resume — suspend or re-enable the hotkey without exiting
- Launch at Login — toggle Windows auto-start (writes to
HKCU\...\Run) - Open Migao Command — open a terminal with
migao status - Check for Updates — open the latest GitHub release
- Report Issue — open the GitHub issue form
- Exit — unregisters the hotkey and removes the tray icon cleanly
After each correction the tooltip briefly shows what changed:
✓ su3cl3 → 你好
While cycling through candidates:
Candidate 2/3: 你好嗎
Reverted to original
migao fix "su3cl3" # 你好
migao fix "5j/ eji6" # 中國
migao fix "ji3vu j;4su3dk3" # 我希望你可以echo "su3cl3" | migao fix
pbpaste | migao fix # macOSmigao fix --top 3 "su3cl3"
# 1 你好
# 2 你號
# 3 你好嗎
# Pick [1-3] (default 1):migao fix --ime zhuyin "su3cl3"
migao fix --ime pinyin "nihao"migao listSupported IME identifiers:
bopomofo-daqian (aliases: zhuyin, 注音) — 大千標準注音鍵盤
pinyin (alias: 拼音) — 全拼(標準 QWERTY)
migao status
migao config
migao config set hotkey Ctrl+Alt+K
migao watch autostart on
migao watch autostart offmigao status shows the installed version, config file path, default IME, hotkey, Launch at Login state, and watcher guidance. It also prints the next management commands to try, so it is the best first stop when troubleshooting.
From the Windows tray menu, Open Migao Command opens a terminal and runs migao status.
The hotkey config currently supports Ctrl+Alt+<A-Z> and is stored in %APPDATA%\Migao\config.toml on Windows. Restart migao-watch after changing the hotkey.
Raw key sequence
│
▼
Segment Split into syllable candidates using Daqian ordering rules
│ (Initial → Medial → Final → Tone). Non-Bopomofo chars pass through.
▼
Decode Each syllable → Bopomofo Unicode (su3 → ㄋㄧˇ)
│
▼
Viterbi DP over syllables finds the highest-probability Chinese word sequence
│ using a 474,000-entry dictionary + bigram language model
▼
Output Traditional Chinese text
A confidence score (ratio of structurally valid Bopomofo syllables) gates the output — English text scores near 0.0 and is rejected automatically.
| Identifier | Aliases | Layout |
|---|---|---|
bopomofo-daqian |
zhuyin, 注音 |
大千標準注音鍵盤 (Standard Daqian) |
pinyin |
拼音 |
全拼 QWERTY |
| Code | Meaning |
|---|---|
| 0 | Recovery succeeded |
| 1 | No rule matched / confidence too low |
migao is also a Rust library:
[dependencies]
migao = "0.4"// Best single recovery
let result = migao::recover("su3cl3", "bopomofo-daqian");
assert_eq!(result.unwrap(), "你好");
// Top-N candidates
let candidates = migao::recover_top_n("su3cl3", "bopomofo-daqian", 3);| Source | License |
|---|---|
| RIME terra_pinyin | Apache 2.0 |
| rime-essay | Apache 2.0 |
| pypinyin | MIT |
MIT AND Apache-2.0
The Apache 2.0 component covers the RIME dictionary data embedded in the binary (data/bopomofo.tsv).
