Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module(
name = "opencc",
version = "1.4.0",
version = "1.4.1",
)

bazel_dep(name = "aspect_bazel_lib", version = "2.22.5")
Expand Down
36 changes: 36 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,41 @@
# Change History of OpenCC

## Version 1.4.1

2026年7月11日

* **發佈重點**:修復 `opencc` npm 套件在沒有預編譯二進制的平台(如 Intel Mac)上退回源碼編譯時,因源碼包缺少檔案而安裝失敗的問題,並新增 darwin-x64(Intel Mac)預編譯 npm 套件;另包含一批詞庫修正、`.ocd` 字典跨平台輸出修復與 Debian 打包流程重建。C++ ABI 與 1.4.0 相同(SOVERSION 1.4),下游程式無需重新鏈結。
* **詞庫更新**:
* 修正「托 / 託」候選順序:`s2t` 中 `托` 預設保留不轉換(如 `托着`、`茶托`、人名音譯),並補充「託」委託義的詞組轉換([#1405](https://github.com/BYVoid/OpenCC/pull/1405))。
* 依《通用規範漢字表》與《現代漢語詞典》修正「牴 → 抵」,以及「復 / 複 / 覆」相關轉換([#758](https://github.com/BYVoid/OpenCC/pull/758))。
* 修正「黄粱美梦」相關轉換:不再輸出「黃樑美夢」,並將 `STPhrases.txt` 中誤作「黄梁」的詞條統一為「黄粱」([#1408](https://github.com/BYVoid/OpenCC/pull/1408), [#1410](https://github.com/BYVoid/OpenCC/pull/1410))。
* `t2s` 新增「遶 → 绕」轉換([#1399](https://github.com/BYVoid/OpenCC/pull/1399));`t2s` 中保留簡體字形「坏」不再誤轉([#1391](https://github.com/BYVoid/OpenCC/pull/1391))。
* 新增書法家「梁昇卿」人名詞條([#1402](https://github.com/BYVoid/OpenCC/pull/1402));新增香港地區詞「舒芙蕾 / 梳芙厘」(soufflé)([#1387](https://github.com/BYVoid/OpenCC/pull/1387))。
* 日文字體:補充 `JPShinjitaiCharacters` 缺失的 11 個新字體字元(依安岡孝一「人名用漢字の新字旧字」),以相容性自映射收錄並用 `@reverse-prefer` 修正 `t2jp` 反向優先序([#1394](https://github.com/BYVoid/OpenCC/pull/1394))。
* **`.ocd` 字典格式 / 字典工具**:
* `BinaryDict` 序列化改為固定寬度(uint32)欄位,使 32-bit 與 64-bit 構建寫出的 `.ocd` 位元組一致;讀取端自動偵測舊版 64-bit 佈局,舊檔案仍可在任何平台載入([#1414](https://github.com/BYVoid/OpenCC/pull/1414))。
* CMake 新增 `OPENCC_DICT_FORMAT` 選項(`ocd2` / `text` / `ocd`),可選擇構建輸出的字典格式,配置 JSON 隨之改寫([#1396](https://github.com/BYVoid/OpenCC/pull/1396))。
* `opencc_dict` 整合 cppjieba 字典轉換(新增 `cppjieba_utf8` 輸入格式),取代並停止安裝原 `cppjieba_dict` 工具([#1392](https://github.com/BYVoid/OpenCC/pull/1392));CMake / Bazel 構建流程進一步改為直接以 `opencc_dict` 生成 jieba 合併詞典並移除私有構建工具,獨立構建 jieba 插件時需系統安裝 OpenCC ≥ 1.4.1 的 `opencc_dict`。
* vendored `darts-clone` 改為從 BCR 引入 `0.32h.bcr.1`,移除本地補丁([#1386](https://github.com/BYVoid/OpenCC/pull/1386), [#1401](https://github.com/BYVoid/OpenCC/pull/1401))。
* **Node.js**:
* 修復 npm 源碼包缺少 `src/ConfigBasedConverter.hpp`、`src/PipelineConverter.cpp/.hpp`、`src/SingleStageConverter.cpp/.hpp`、`src/opencc_config_schema.inc` 六個編譯所需檔案,導致 `npm install` 源碼編譯失敗([#1409](https://github.com/BYVoid/OpenCC/issues/1409), [#1411](https://github.com/BYVoid/OpenCC/pull/1411))。
* 新增 `@opencc/opencc-darwin-x64` 與 `@opencc/opencc-jieba-darwin-x64` 預編譯套件,Intel Mac 不再需要源碼編譯([#1411](https://github.com/BYVoid/OpenCC/pull/1411))。
* `opencc-jieba` 預編譯二進制的 macOS 最低版本從構建機的 15.0 降至 11.0,與 `opencc` 主套件的預編譯二進制一致。
* `prepack` 驗證腳本新增 gyp 源碼與 `#include` 閉包檢查,確保源碼編譯所需的所有檔案都在 npm 包的 `files` 白名單內,防止同類問題再次發生。
* CI 新增「從 `npm pack` 產出的 tarball 進行源碼編譯並安裝」的測試(ubuntu / macOS ARM / macOS Intel),覆蓋無預編譯二進制平台的實際安裝路徑。
* JavaScript API 支援以 inline config 物件建立轉換器,保留原有字串配置行為;並覆蓋 bundled assets、自定義配置目錄與 tofu-risk 過濾的測試([#1412](https://github.com/BYVoid/OpenCC/pull/1412))。
* `OpenCCConfig` TypeScript 型別改由 JSON schema 自動生成,取代原本寬鬆的 `Record` 型別([#1413](https://github.com/BYVoid/OpenCC/pull/1413))。
* Node 預編譯二進制(`@opencc/opencc-*` scoped 套件)改用 Bazel 構建發佈,`npm run prebuild`(prebuildify / node-gyp)不再是官方發佈二進制的構建方式;Bazel 不支援的平台從此不再提供官方預編譯二進制,在這些平台上 `npm install` 目前仍會退回 node-gyp 源碼編譯,但此 fallback(`binding.gyp`)已計劃在後續版本中移除,屆時 Node 構建將統一使用 Bazel([#1416](https://github.com/BYVoid/OpenCC/pull/1416))。
* 重寫 Node demo 範例([commit](https://github.com/BYVoid/OpenCC/commit/6b382c6489efe4874350ec33531b46b32e08c2d5))。
* **打包 / 構建系統**:
* 重建 Debian 打包流程:新增頂層 `debian/` 目錄使 `dpkg-buildpackage` 可端到端重現 Debian 構建,`packaging/debian/` 補丁鏡像與 ver.1.4.0 源碼對齊,並改進 deb 構建腳本與 workflow([#1398](https://github.com/BYVoid/OpenCC/pull/1398), [#1385](https://github.com/BYVoid/OpenCC/pull/1385), [#1406](https://github.com/BYVoid/OpenCC/pull/1406))。
* Bazel 升級至 9.1.1([#1384](https://github.com/BYVoid/OpenCC/pull/1384));`rules_node_addon` 更新至 BCR 1.0.3([#1370](https://github.com/BYVoid/OpenCC/pull/1370))。
* MSVC `/W4` 改用 `add_compile_options` 設定,避免 `rc.exe` 資源編譯失敗([#1393](https://github.com/BYVoid/OpenCC/pull/1393));CMake 恢復支援舊式 Python executable 選項([#1389](https://github.com/BYVoid/OpenCC/pull/1389))。
* 新增 `opencc-v<version>-resources.zip` 資源包發佈 workflow;`release-pypi` workflow 新增 push tag 觸發,與其他發佈 workflow 一致。
* 穩定 Doxygen 文檔頁面 anchor ID,不再隨構建路徑變化([#1400](https://github.com/BYVoid/OpenCC/pull/1400))。
* **測試**:
* 新增 librime OpenCC 相容性測試,覆蓋 `GetConversionChain`、精確詞條展開與前綴匹配 fallback([#1395](https://github.com/BYVoid/OpenCC/pull/1395))。

## Version 1.4.0

2026年7月1日
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,16 @@ Discussion (Telegram): https://t.me/open_chinese_convert

### Prebuilt binaries 預編譯二進位檔

OpenCC 1.4.0 主要更新是將 C++ ABI / SOVERSION 提升至 1.4,避免舊版
`libopencc.so.1.3` 使用者靜默載入 ABI 不相容的新版本;下游 C++ 程式需重新鏈結。
OpenCC 1.4.1 修復 `opencc` npm 套件在無預編譯二進制平台上源碼編譯安裝失敗的
問題,並包含一批詞庫修正;C++ ABI 與 1.4.0 相同(SOVERSION 1.4),自 1.4.0
升級的下游 C++ 程式無需重新鏈結。

* Windows (x86_64): [OpenCC-1.4.0](https://github.com/BYVoid/OpenCC/releases/download/ver.1.4.0/OpenCC-1.4.0-windows-x64-portable.zip) ([SHA-256](https://github.com/BYVoid/OpenCC/releases/download/ver.1.4.0/OpenCC-1.4.0-windows-x64-portable.zip.sha256))
* Windows (x86_64): [OpenCC-1.4.1](https://github.com/BYVoid/OpenCC/releases/download/ver.1.4.1/OpenCC-1.4.1-windows-x64-portable.zip) ([SHA-256](https://github.com/BYVoid/OpenCC/releases/download/ver.1.4.1/OpenCC-1.4.1-windows-x64-portable.zip.sha256))
* This Windows release is available from WinGet. For details, see [doc/windows-winget-release.md](doc/windows-winget-release.md).
* Requires Microsoft Visual C++ Redistributable for Visual Studio 2015-2026. Download the latest version from [Microsoft](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170#latest-supported-redistributable-version).
* Debian/Ubuntu (amd64):
* [opencc_1.4.0_amd64.deb](https://github.com/BYVoid/OpenCC/releases/download/ver.1.4.0/opencc_1.4.0_amd64.deb)
* [opencc-jieba_1.4.0_amd64.deb](https://github.com/BYVoid/OpenCC/releases/download/ver.1.4.0/opencc-jieba_1.4.0_amd64.deb)
* [opencc_1.4.1_amd64.deb](https://github.com/BYVoid/OpenCC/releases/download/ver.1.4.1/opencc_1.4.1_amd64.deb)
* [opencc-jieba_1.4.1_amd64.deb](https://github.com/BYVoid/OpenCC/releases/download/ver.1.4.1/opencc-jieba_1.4.1_amd64.deb)

## Usage 使用

Expand Down
2 changes: 1 addition & 1 deletion node/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ node_addon(
"//conditions:default": ["-std=c++20"],
}),
defines = [
'OPENCC_VERSION=\\"1.4.0\\"',
'OPENCC_VERSION=\\"1.4.1\\"',
"NAPI_DISABLE_CPP_EXCEPTIONS",
"Opencc_BUILT_AS_STATIC",
],
Expand Down
3 changes: 2 additions & 1 deletion node/PUBLISHING.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ prebuilds/<current-platform>-<current-arch>/opencc.node
The release workflow runs the Bazel build script separately on the runner for
each scoped binary target. The main `opencc` package still keeps `binding.gyp`
and source files so installs on platforms without a scoped binary package can
fall back to `node-gyp-build`.
fall back to `node-gyp-build`. This fallback is planned for removal in a
future release, after which all Node builds will use Bazel exclusively.

## Prepare scoped binary packages

Expand Down
2 changes: 1 addition & 1 deletion node/global.gypi
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"variables": {
"opencc_version": "1.4.0"
"opencc_version": "1.4.1"
},
"target_defaults": {
"defines": [
Expand Down
71 changes: 18 additions & 53 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "opencc",
"version": "1.4.0",
"version": "1.4.1",
"description": "Conversion between Traditional and Simplified Chinese",
"author": "Carbo Kuo <byvoid@byvoid.com>",
"license": "Apache-2.0",
Expand Down Expand Up @@ -159,10 +159,11 @@
"node-gyp-build": "^4.8.4"
},
"optionalDependencies": {
"@opencc/opencc-darwin-arm64": "1.4.0",
"@opencc/opencc-linux-arm64": "1.4.0",
"@opencc/opencc-linux-x64": "1.4.0",
"@opencc/opencc-win32-x64": "1.4.0"
"@opencc/opencc-darwin-arm64": "1.4.1",
"@opencc/opencc-darwin-x64": "1.4.1",
"@opencc/opencc-linux-arm64": "1.4.1",
"@opencc/opencc-linux-x64": "1.4.1",
"@opencc/opencc-win32-x64": "1.4.1"
},
"overrides": {
"brace-expansion": "^2.0.3",
Expand Down
6 changes: 3 additions & 3 deletions packaging/debian/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ It is not the authoritative Debian packaging source.

This patch set is based on:

- Upstream: BYVoid/OpenCC `ver.1.4.0`
- Upstream: BYVoid/OpenCC `ver.1.4.1`
- Debian source package: `opencc 1.3.1+ds1-3`
- Debian packaging repository:
https://salsa.debian.org/debian/opencc
Expand All @@ -29,9 +29,9 @@ This is the complete active set.

Patch numbering reflects historical Debian quilt ordering and is not contiguous.

## 3. Patch status against upstream 1.4.0
## 3. Patch status against upstream 1.4.1

All patches have been re-based against upstream `1.4.0` and verified to apply cleanly:
All patches have been re-based against upstream `1.4.1` and verified to apply cleanly:

- `patch -p1 --fuzz=0` compatibility
- tested in clean upstream checkout
Expand Down
12 changes: 6 additions & 6 deletions packaging/debian/SPLIT_PROPOSAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This is a proposal from upstream, not a Debian upload. It was produced by
overlaying the top-level `debian/` directory onto a clean checkout of
upstream `BYVoid/OpenCC` at `master` (1.4.0) and actually running
upstream `BYVoid/OpenCC` at `master` (1.4.1) and actually running
`dpkg-buildpackage -us -uc -b` there, on Ubuntu 24.04 with debhelper
13.14. All six binary packages built, `dh_missing --fail-missing` found
nothing unclaimed, `ctest` passed 19/19, and `lintian --pedantic`
Expand Down Expand Up @@ -69,11 +69,11 @@ release artifact for continuity:

Depends: `opencc (= ${binary:Version})`, `libopencc-data (>= ${source:Version})`.

`plugins/jieba/CMakeLists.txt` also builds `opencc_jieba_dict_build_tool`,
the offline tool that merges the bundled Jieba dictionaries into
`jieba_dict/jieba_merged.ocd2` at build time. Upstream does not
`install()` this tool, so it is a build dependency only and is not
shipped in `opencc-jieba` (or any package) here either.
The merged Jieba dictionary (`jieba_dict/jieba_merged.ocd2`) is generated
at build time by upstream's own `opencc_dict` tool
(`--from cppjieba_utf8`), which is built in-tree during the package build
and already shipped in the `opencc` binary package; no additional
dictionary tool is built or shipped.

Known blocker for a real Debian upload: `plugins/jieba/deps/cppjieba` is
a header-only C++ library with **no existing Debian package** to build
Expand Down
4 changes: 2 additions & 2 deletions packaging/debian/debian/README.source
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ checkout of upstream BYVoid/OpenCC (e.g. `cp -r packaging/debian/debian
<upstream-checkout>/debian`) and run `dpkg-buildpackage` from there.

This debian/ directory is authored against upstream BYVoid/OpenCC's file
layout at 1.4.0, and was validated by running `dpkg-buildpackage -us -uc
layout at 1.4.1, and was validated by running `dpkg-buildpackage -us -uc
-b` against a clean checkout of upstream `master` (all six binary
packages build, `dh_missing --fail-missing` finds nothing unclaimed,
`ctest` passes 19/19, and `lintian --pedantic` reports no errors). It
authored strictly against the file layout present in the upstream source
tree at 1.4.0 — building it against any checkout that contains files
tree at 1.4.1 — building it against any checkout that contains files
beyond what upstream ships will cause dh_missing to fail on those extra
files.

Expand Down
15 changes: 15 additions & 0 deletions packaging/debian/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
opencc (1.4.1-1) UNRELEASED; urgency=medium

* Update packaging for the upstream 1.4.1 release:
- Rebase 0004 (use system-installed googletest) against 1.4.1; the
ENABLE_GTEST block gained a bundled-source existence check that
shifted the hunk context. 0003, 0005 and 0009 apply unchanged. All
four patches verified with `patch -p1 --fuzz=0` against upstream
1.4.1 sources.
- Drop usr/bin/cppjieba_dict from opencc-jieba.install: upstream now
generates the merged Jieba dictionary with the regular opencc_dict
tool (shipped in the opencc package) and no longer builds or
installs a separate dictionary helper.

-- Frank Lin <github@linshuang.info> Sat, 11 Jul 2026 00:00:00 +0000

opencc (1.4.0-1) UNRELEASED; urgency=medium

* Recreate the Debian packaging flow on top of the existing
Expand Down
1 change: 0 additions & 1 deletion packaging/debian/debian/opencc-jieba.install
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
usr/bin/cppjieba_dict
usr/lib/*/opencc/plugins
usr/share/opencc/jieba_dict
usr/share/opencc/hk2sp_jieba.json
Expand Down
14 changes: 7 additions & 7 deletions packaging/debian/debian/patches/0004-Use-system-googletest.patch
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ From: Shengjing Zhu <zhsj@debian.org>
Date: Sun, 28 Jul 2024 19:44:27 -0400
Subject: Use system-installed googletest via CMake package discovery

Rebased for opencc 1.4.0: the ENABLE_GTEST block gained a bundled-source
existence check ahead of the USE_SYSTEM_GTEST branch since this patch
was written, so the else() is now attached further down; only that
if/else/endif is touched here.
Rebased for opencc 1.4.1: the ENABLE_GTEST block gained a bundled-source
existence check ahead of the USE_SYSTEM_GTEST branch since 1.4.0 (source
package profiles may strip deps/googletest), shifting this hunk's
context; only the if/else/endif around add_subdirectory is touched here.

Forwarded: not-needed
Last-Update: 2026-07-04
Last-Update: 2026-07-11
---
--- OpenCC.orig/CMakeLists.txt
+++ OpenCC/CMakeLists.txt
@@ -309,6 +309,8 @@ endif()
if (ENABLE_GTEST)
@@ -395,6 +395,8 @@
endif()
if(NOT USE_SYSTEM_GTEST)
add_subdirectory(deps/googletest-1.15.0)
+ else()
Expand Down
15 changes: 2 additions & 13 deletions plugins/jieba/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,8 @@ genrule(
"//plugins/jieba/deps/cppjieba:dict/user.dict.utf8",
],
outs = ["jieba_dict/jieba_merged.ocd2"],
cmd = "$(location :opencc_jieba_dict_build_tool) -i $(location //plugins/jieba/deps/cppjieba:dict/jieba.dict.utf8) -i $(location //plugins/jieba/deps/cppjieba:dict/user.dict.utf8) -o $@",
tools = [":opencc_jieba_dict_build_tool"],
)

cc_binary(
name = "opencc_jieba_dict_build_tool",
srcs = ["tools/JiebaDictBuildTool.cpp"],
deps = [
"//src:dict_lib",
"//src:dict_entry_lib",
"//src:lexicon_lib",
"//src:marisa_dict_lib",
],
cmd = "$(location //src/tools:dict_converter) --from cppjieba_utf8 --to ocd2 --input $(location //plugins/jieba/deps/cppjieba:dict/jieba.dict.utf8) --input $(location //plugins/jieba/deps/cppjieba:dict/user.dict.utf8) --output $@",
tools = ["//src/tools:dict_converter"],
)

cc_test(
Expand Down
Loading
Loading