nodejs/node · error

U_UNSUPPORTED_ERROR

U_UNSUPPORTED_ERROR

Error message

icupkg/ures_enumDependencies(%s res=%08x) %%ALIAS contains a '/'\n

What it means

Thrown by ures_enumDependencies when an ALIAS resource of type URES_STRING (not an integer alias) contains a '/' character. ICU locale IDs must not contain slashes; a slash indicates the alias was meant to point to another package or bundle path (e.g. /ICUDATA/...) which is only valid for integer-typed aliases. For a plain string alias the entire value is expected to be a locale ID, so finding a '/' signals a corrupted or malformed resource bundle.

Source

Thrown at deps/icu-small/source/tools/toolutil/pkgitems.cpp:255

    // locale_ID

    // search for the first slash
    for(i=0; i<length && alias[i]!=SLASH; ++i) {}

    if(res_getPublicType(res)==URES_ALIAS) {
        // ignore aliases with an initial slash:
        // /ICUDATA/... and /pkgname/... go to a different package
        // /LOCALE/... are for dynamic sideways fallbacks and don't go to a fixed bundle
        if(i==0) {
            return; // initial slash ('/')
        }

        // ignore the intra-bundle path starting from the first slash ('/')
        length=i;
    } else /* URES_STRING */ {
        // the whole string should only consist of a locale ID
        if(i!=length) {
            fprintf(stderr, "icupkg/ures_enumDependencies(%s res=%08x) %%ALIAS contains a '/'\n",
                            itemName, res);
            *pErrorCode=U_UNSUPPORTED_ERROR;
            return;
        }
    }

    // convert the Unicode string to char *
    char localeID[48];
    if (length >= static_cast<int32_t>(sizeof(localeID))) {
        fprintf(stderr, "icupkg/ures_enumDependencies(%s res=%08x) alias locale ID length %ld too long\n",
                        itemName, res, static_cast<long>(length));
        *pErrorCode=U_BUFFER_OVERFLOW_ERROR;
        return;
    }
    u_UCharsToChars(alias, localeID, length);
    localeID[length]=0;

    checkIDSuffix(itemName, localeID, -1, (useResSuffix ? ".res" : ""), check, context, pErrorCode);

View on GitHub (pinned to 1b2de5e052)

Solutions

  1. Rebuild the offending .res bundle from canonical ICU source data rather than a patched copy.
  2. Inspect the alias resource with genrb -d or icuinfo to identify which key has the bad alias value.
  3. Regenerate the resource bundle with genrb from the original .txt source, ensuring alias values are pure locale IDs without '/' characters.

Example fix

// before (in .txt resource source):
MyLocale:alias("/ICUDATA/root")  // string alias with slash → triggers error

// after: use an integer alias or reference the correct bundle format:
MyLocale:alias("root")  // pure locale ID, no slash
Defensive patterns

Strategy: validation

Validate before calling

// Before running icupkg, validate alias resources in .txt source:
// Ensure no URES_STRING alias value contains '/' unless it's an integer alias path.
// Regex check on alias values: ^[^/]+$ (pure locale ID, no slash)
import re
def validate_alias(alias_value: str) -> bool:
    return '/' not in alias_value  # locale IDs must not contain '/'

Try / catch

// icupkg is a CLI tool; check exit code and stderr
import subprocess
result = subprocess.run(['icupkg', '--list', 'bundle.res'], capture_output=True)
if result.returncode != 0:
    stderr = result.stderr.decode()
    if 'ALIAS' in stderr and "contains a '/'" in stderr:
        print(f'Malformed alias in bundle: {stderr}')

Prevention

When it happens

Trigger: Calling icupkg to enumerate dependencies on a .res bundle where an %%ALIAS entry is a URES_STRING whose value contains a '/'. The code path: ures_enumDependencies → detects URES_STRING alias → scans for '/' via u_strchr → finds one at position i!=length → sets U_UNSUPPORTED_ERROR.

Common situations: Building ICU data with a hand-edited or corrupted .res file; using an alias string that accidentally includes a path separator; locale ID generation bug that inserts a slash; mismatched ICU versions where alias encoding changed.

Related errors


AI-assisted analysis of nodejs/node@1b2de5e052 (2026-08-13). Data as JSON: /api/errors/5f38e6df9b3a2456. Report an issue: GitHub.