{"record":{"id":"03a9271aa077f1ce","repo":"quarkusio/quarkus","slug":"expresion-command-must-be-an-ascii-char-comma","errorCode":null,"errorMessage":"Expresion command must be an ASCII char: \" + command","messagePattern":"Expresion command must be an ASCII char: \" \\+ command","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"independent-projects/qute/core/src/main/java/io/quarkus/qute/ParserConfig.java","lineNumber":24,"sourceCode":" * The set of possible expression commands is limited.\n * Only ASCII characters are allowed.\n * Some characters are reserved: {@code #}, {@code /}, {@code @}, {@code _}, {@code |}, {@code !}.\n * Digit/alphabetic chars are also disallowed.\n *\n * @param expressionCommand the command characted used to identify an output expression\n */\npublic record ParserConfig(Character expressionCommand) {\n\n    /**\n     * By default, no special expression command is used.\n     */\n    public static final ParserConfig DEFAULT = new ParserConfig(null);\n\n    public ParserConfig {\n        if (expressionCommand != null) {\n            char command = expressionCommand.charValue();\n            if (command < 0 || command > 127) {\n                throw new IllegalArgumentException(\"Expresion command must be an ASCII char: \" + command);\n            }\n            if (Parser.Tag.isCommand(command, null)\n                    || command == Parser.COMMENT_DELIMITER\n                    || command == Parser.CDATA_START_DELIMITER\n                    || command == Parser.UNDERSCORE) {\n                throw new IllegalArgumentException(\"Expresion command is reserved: \" + command);\n            }\n            if (Character.isDigit(command)\n                    || Character.isAlphabetic(command)) {\n                throw new IllegalArgumentException(\"Expresion command must not be a digit/alphabetic: \" + command);\n            }\n        }\n    }\n\n}","sourceCodeStart":6,"sourceCodeEnd":39,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/qute/core/src/main/java/io/quarkus/qute/ParserConfig.java#L6-L39","documentation":"Thrown by the ParserConfig compact constructor when the configured expression command character is not an ASCII character (code point 0-127). Qute allows changing the default '{' expression delimiter only to a single ASCII char.","triggerScenarios":"Calling EngineBuilder.parser(new ParserConfig(expressionCommand)) (or ParserConfig constructor) with a String whose char value is outside 0-127, e.g. '{ƒ' or any non-Latin character.","commonSituations":"Users picking a delimiter from a non-ASCII keyboard layout or copying a lookalike character (fullwidth '｛', curly quotes) into configuration; building the config from user input without validation.","solutions":["Choose a plain ASCII character as the expression command, e.g. '$' or '#'.","Validate the character before constructing ParserConfig: check c >= 0 && c <= 127.","If the desired symbol is non-ASCII, transliterate it to an ASCII equivalent."],"exampleFix":"// before\nParserConfig config = new ParserConfig('｛'); // fullwidth char, non-ASCII\n\n// after\nParserConfig config = new ParserConfig('$'); // ASCII char","handlingStrategy":"validation","validationCode":"char c = expressionCommand.charAt(0);\nif (c < 0 || c > 127) {\n    throw new IllegalArgumentException(\"expression command must be ASCII, got: \" + (int) c);\n}","typeGuard":"static boolean isAsciiChar(String s) {\n    return s != null && s.length() == 1 && s.charAt(0) <= 127;\n}","tryCatchPattern":"try {\n    ParserConfig config = new ParserConfig(expressionCommand);\n} catch (IllegalArgumentException e) {\n    // fall back to default config (null = '{') and log a warning\n    ParserConfig config = ParserConfig.DEFAULT;\n}","preventionTips":["Restrict delimiter configuration input to a single ASCII punctuation character","Never take delimiter chars from unvalidated user input","Watch for non-ASCII lookalike characters when copying config values"],"tags":["qute","configuration","illegal-argument","delimiter"],"backgroundTag":"invalid-delimiter-char","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}