When using addSpot, encoding gets broken for non-Latin names
There is a persistent encoding bug in the Illustrator Scripting API (ExtendScript) when moving Global or Spot swatches into a SwatchGroup. Specifically, the addSpot() method fails to preserve Unicode characters, resulting in corrupted strings for any non-Latin swatch names (Chinese, Japanese, Russian, etc.).
Example:
var doc = app.activeDocument;
// 1. Create a color group
var targetGroup = doc.swatchGroups.add();
targetGroup.name = 'Spot_Test';
// 2. Create a color object
var swatchColor = new CMYKColor();
swatchColor.cyan = 80;
// 3. Create a swatch with a name in Cyrillic or another language
var newSwatch = doc.spots.add();
newSwatch.name = 'Синий';
newSwatch.colorType = ColorModel.SPOT;
newSwatch.color = swatchColor;
// 4. Moving a swatch to a group
targetGroup.addSpot(newSwatch);
Version Range: This issue has been present since CS6 and remains in the current 2026 release.
Platform: Reproducible on both macOS and Windows.
Impact: Affects all automation tools and scripts dealing with brand assets, localized palettes, and pre-press workflows in non-English environments.
Full technical breakdown and details:
https://aiscripts.medium.com/non-latin-spot-color-names-in-swatch-groups-2cd075e6ae82
-
Sergey Osokin
commented
A similar problem with spot names encoding https://illustrator.uservoice.com/forums/908050-illustrator-desktop-sdk-scripting-issues/suggestions/48608555-when-getting-ink-name-encoding-gets-broken-for-no