oracle/graal · error · IllegalArgumentException

Unsupported Unicode %s '%s'

Error message

Unsupported Unicode %s '%s'

What it means

returnOrThrow is the shared helper for alias lookup of property, general category, script, and block names. When the database's lookup returns null (name is not a recognized alias under the current matching mode), it throws IllegalArgumentException "Unsupported Unicode %s '%s'" naming the kind (character property / general category / script name / block name) and the input.

Source

Thrown at regex/src/com.oracle.truffle.regex/src/com/oracle/truffle/regex/charset/UnicodeProperties.java:229

    }

    public boolean isSupportedGeneralCategory(String generalCategoryName) {
        return data.lookupGeneralCategoryAlias(generalCategoryName, nameMatchingMode) != null;
    }

    public boolean isSupportedScript(String scriptName) {
        return data.lookupScriptAlias(scriptName, nameMatchingMode) != null;
    }

    public boolean isSupportedBlock(String blockName) {
        assert withBlocks();
        return data.lookupBlockAlias(blockName, nameMatchingMode) != null;
    }

    private static String returnOrThrow(String propertyName, String errorName, String name) {
        if (name == null) {
            CompilerDirectives.transferToInterpreterAndInvalidate();
            throw new IllegalArgumentException(String.format("Unsupported Unicode %s '%s'", errorName, propertyName));
        }
        return name;
    }

}

View on GitHub (pinned to a66e9ccd1d)

Solutions

  1. Check the exact alias tables for the engine's Unicode version; prefer canonical short names (gc=Lu, sc=Latn, blk=Basic_Latin).
  2. Fix typos and separators in the property spec.
  3. Upgrade GraalVM/TRegex if the alias exists in a newer Unicode version.
  4. Substitute an explicit character range when no supported name exists.

Example fix

// before
compile("\\p{script=greek}"); // 'greek' not an alias under current matching mode

// after
compile("\\p{sc=Grek}"); // canonical script alias
Defensive patterns

Strategy: validation

Validate before calling

// validate names against the engine's lookup before compiling
boolean ok = props.isSupportedProperty(name) 
        || props.isSupportedGeneralCategory(name) 
        || props.isSupportedScript(name) 
        || props.isSupportedBlock(name);

Try / catch

try {
    return engine.compile(pattern);
} catch (IllegalArgumentException e) {
    if (e.getMessage().startsWith("Unsupported Unicode")) {
        throw new IllegalArgumentException("Bad property name in pattern: " + pattern, e);
    }
    throw e;
}

Prevention

When it happens

Trigger: An unknown or misspelled name in \p{...} or \p{...=...}: \p{General_Category=Leter}, \p{sc=Unknown_Script_Name}, \p{gc=Ltt} where the alias is not in the database, or names that only match under loose matching when strict matching is active.

Common situations: Typos and case errors in property names; using long descriptive names where only short aliases exist (or vice versa); Unicode version drift where an alias was added later; copy-pasting ICU/Perl property names unsupported here.

Related errors


AI-assisted analysis of oracle/graal@a66e9ccd1d (2026-08-14). Data as JSON: /api/errors/cad318b8740252f1. Report an issue: GitHub.