AETERNAE AI RESEARCH LLC INDEPENDENT RESEARCH
ÆAETERNAERESEARCH
Sign inRequest access
← Malware catalog

Attributed metadata history

REPORTPUBLIC METADATA

Simplified to Traditional Chinese in ~60 lines of JS: an ICU-generated map plus a phrase table

I run a practice-test site for the California DMV written test. It has English, Simplified Chinese and Traditional Chinese versions, and the Traditional pages are produced from the Simplified content at render time by one function, toTraditional(). It started as a hand-written character map. That kept missing characters: a post would go live on the Traditional side with a few Simplified characters left in the middle of a sentence. This is how I replaced it with a generated table and kept the hand-written part only for the cases a table can't handle. Step 1: generate a one-to-one map from ICU macOS ships ICU, and ICU has a Hans-Hant transform. You can reach it from JavaScript for Automation, so a Node script can call osascript and get the mapping without downloading anything. The script walks the CJK Unified Ideographs block (U+4E00 to U+9FFF) one character at a time and keeps only the characters where the transform gives back a different, single character: const jxa = `ObjC.import("Foundation"); var out = []; for (var c = 0x4E00; c <= 0x9FFF; c++) { var ch = String.fromCharCode(c); var t = $.NSString.alloc.initWithUTF8String(ch) .stringByApplyingTransformReverse("Hans-Hant", false).js; if (t !== ch && t.length === 1) out.push(ch + t); } out.join("")`; const pairs = execFileSync('osascript', ['-l', 'JavaScript', '-e', jxa], { encoding: 'utf8', maxBuffer: 1 << 24, }).trim(); The output goes into a generated file as two strings, where S2T_FROM[i] converts to S2T_TO[i]. In my case that's 2,544 characters. The script runs on macOS only, but the file it writes is plain JS and works anywhere. Step 2: leave out the characters with more than one Traditional form Converting one character at a time is wrong for some characters, because a single Simplified character can stand for several Traditional ones and ICU only returns one. These are the ones that hit my content: 干 can be 乾 (dry), 幹 (trunk, as in 題幹 "question stem") or stay 干 (干擾 "interfere") 发 is 發 in most words but 髮 in hair words (頭髮, 理髮) 里 is 裡 for "inside" but stays 里 in 里程 (mileage) 余, 台, 只, 面, 系, 制, 松, 卷, 斗, 丑, 脏, 舍 and 沉 have the same problem So the generator skips them: const EXCLUDE = new Set([...'干舍沉斗丑脏里余制台只面卷松系']); It also swaps a couple of ICU's choices for the forms Taiwanese readers expect (鉴 to 鑑, 启 to 啟). Step 3: phrases first, longest match wins The excluded characters get converted inside known phrases instead. The phrase table is small and hand-written: 头发 → 頭髮, 干净 → 乾淨, 题干 → 題幹, 干扰 → 干擾, 余光 → 餘光, 宿舍 → 宿舍, and so on. Phrases are grouped by their first character and sorted longest first. The converter makes a single pass: at each position it tries the phrases that start with the current character, and only falls back to the character map when none match. const phrasesByFirst = new Map(); Object.entries(phraseMap) .sort(([a], [b]) => b.length - a.length) .forEach(([source, target]) => { if (!phrasesByFirst.has(source[0])) phrasesByFirst.set(source[0], []); phrasesByFirst.get(source[0]).push([source, target]); }); export const toTraditional = (text = '') => { const input = String(text || ''); let out = ''; for (let i = 0; i < input.length;) { const match = phrasesByFirst.get(input[i]) ?.find(([source]) => input.startsWith(source, i)); if (match) { out += match[1]; i += match[0].length; } else { out += charMap.get(input[i]) || input[i]; i += 1; } } return out; }; Because it's one pass, text that a phrase produced is never converted again. My earlier version ran phrase replacements and then character replacements over the whole string, and the second step could undo the first. The character map is built from the generated

Reference details

Source category
research-report
First reported
Dec 02, 2026 18:09 UTC
Last reported
Dec 02, 2026 18:09 UTC
Catalog updated
Dec 02, 2026 18:24 UTC
Record ID
195481054c668f019991763b048a97086a0c74d262888285713e8c347db72c81

Published indicators

Network indicators are visibly defanged. This page does not make them clickable or send them to another service.

No validated file hashes or network indicators are stored for this record.

Source observations

intelligence_src_6dc544294b7f21f98a

Source-provided label
Publisher RSS metadata
Evidence class
mentioned in report
Confidence
Not reported
Observed
Dec 02, 2026 18:09 UTC
Retrieved
Dec 02, 2026 18:24 UTC

This record contains metadata and attribution only. It does not host, download, unpack, render, or execute malware samples.

Feed collection status

Sources represented on this page. Publication and observation dates describe the content; successful batch dates describe local collection. A recent batch does not certify complete coverage or current provider availability.

1 sources: 0 stale, 0 needing attention, 0 paused, 0 unverified.

Review source update dates and status
  • intelligence_src_6dc544294b7f21f98aRecent successful batchLast successful batch: Last attempt:

Stale means older than twice the recorded collection interval, with a minimum of one hour; without an interval, the threshold is 24 hours. Cached content remains available while a feed is stale, paused, or unverified.