{"record":{"id":"21370a8438da1488","repo":"alibaba/nacos","slug":"malformed-uxxxx-encoding","errorCode":null,"errorMessage":"Malformed \\uxxxx encoding.","messagePattern":"Malformed \\\\uxxxx encoding\\.","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"sys/src/main/java/com/alibaba/nacos/sys/env/OriginTrackedPropertiesLoader.java","lineNumber":227,"sourceCode":"                this.columnNumber = -1;\n                read(true);\n            } else if (this.character == 'u') {\n                readUnicode();\n            }\n        }\n        \n        private void readUnicode() throws IOException {\n            this.character = 0;\n            for (int i = 0; i < 4; i++) {\n                int digit = this.reader.read();\n                if (digit >= '0' && digit <= '9') {\n                    this.character = (this.character << 4) + digit - '0';\n                } else if (digit >= 'a' && digit <= 'f') {\n                    this.character = (this.character << 4) + digit - 'a' + 10;\n                } else if (digit >= 'A' && digit <= 'F') {\n                    this.character = (this.character << 4) + digit - 'A' + 10;\n                } else {\n                    throw new IllegalStateException(\"Malformed \\\\uxxxx encoding.\");\n                }\n            }\n        }\n        \n        public boolean isWhiteSpace() {\n            return !this.escaped\n                && (this.character == ' ' || this.character == '\\t' || this.character == '\\f');\n        }\n        \n        public boolean isEndOfFile() {\n            return this.character == -1;\n        }\n        \n        public boolean isEndOfLine() {\n            return this.character == -1 || (!this.escaped && this.character == '\\n');\n        }\n        \n        public boolean isListDelimiter() {","sourceCodeStart":209,"sourceCodeEnd":245,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/sys/src/main/java/com/alibaba/nacos/sys/env/OriginTrackedPropertiesLoader.java#L209-L245","documentation":"Thrown by OriginTrackedPropertiesPropertiesLoader's readUnicode() when a '\\u' escape in a .properties file is followed by something other than four hex digits. Java properties require exactly four hex characters after \\u.","triggerScenarios":"A properties file contains a \\uXXXX sequence where at least one of the four characters is not 0-9, a-f, or A-F (e.g. '\\u00G1', '\\u12', '\\uXYZW'), or the sequence is truncated (fewer than four chars before EOF).","commonSituations":"Hand-edited properties with a malformed unicode escape; an editor or encoding-conversion tool corrupted a \\u sequence; a file saved as Latin-1 with stray backslash-u sequences; copy/paste of a literal backslash-u meant as text.","solutions":["Open the offending .properties file and locate the \\u escape near the error.","Replace the malformed sequence with a valid four-hex-digit escape (e.g. \\u00e9 for é), or use the literal UTF-8 character.","If '\\u' was meant literally (e.g. in documentation text), escape the backslash as '\\\\u'.","Save the file as UTF-8 and use native characters instead of escapes where possible.","Run a properties linter/validator to catch stray escapes."],"exampleFix":"# before (broken escape)\napp.title=caf\\u00eg\n\n# after (valid escape or literal)\napp.title=caf\\u00e9\n# or, in a UTF-8 file:\napp.title=café","handlingStrategy":"validation","validationCode":"String v = Files.readString(Path.of(file));\njava.util.regex.Matcher m = java.util.regex.Pattern.compile(\"\\\\\\\\u(?!([0-9a-fA-F]{4})).*\").matcher(v);\nif (m.find()) {\n    throw new IllegalStateException(\"Malformed \\\\u escape near: \" + m.group());\n}","typeGuard":null,"tryCatchPattern":"try {\n    // load properties via OriginTrackedPropertiesLoader\n} catch (IllegalStateException e) {\n    if (e.getMessage() != null && e.getMessage().contains(\"Malformed \\\\uxxxx\")) {\n        // point user at the offending .properties file and line\n    }\n    throw e;\n}","preventionTips":["Save .properties files as UTF-8 and prefer literal characters over \\u escapes.","Escape literal backslash-u as \\\\u.","Lint properties files in CI to catch malformed escapes."],"tags":["sys","properties","encoding","startup"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}