{"record":{"id":"709be9ba396ca515","repo":"dromara/Sa-Token","slug":"12104","errorCode":"12104","errorMessage":"{cause}","messagePattern":"\\{cause\\}","errorType":"exception","errorClass":"SaTokenException","httpStatus":null,"severity":"info","filePath":"sa-token-core/src/main/java/cn/dev33/satoken/util/SaFoxUtil.java","lineNumber":598,"sourceCode":"\t */\n\tpublic static String encodeUrl(String url) {\n\t\ttry {\n\t\t\treturn URLEncoder.encode(url, \"UTF-8\");\n\t\t} catch (UnsupportedEncodingException e) {\n\t\t\tthrow new SaTokenException(e).setCode(SaErrorCode.CODE_12103);\n\t\t}\n\t}\n\n\t/**\n\t * URL解码\n\t * @param url see note\n\t * @return see note\n\t */\n\tpublic static String decoderUrl(String url) {\n\t\ttry {\n\t\t\treturn URLDecoder.decode(url, \"UTF-8\");\n\t\t} catch (UnsupportedEncodingException e) {\n\t\t\tthrow new SaTokenException(e).setCode(SaErrorCode.CODE_12104);\n\t\t}\n\t}\n\n\t/**\n\t * 将指定字符串按照逗号分隔符转化为字符串集合\n\t * @param str 字符串\n\t * @return 分割后的字符串集合\n\t */\n\tpublic static List<String> convertStringToList(String str) {\n\t\tList<String> list = new ArrayList<>();\n\t\tif(isEmpty(str)) {\n\t\t\treturn list;\n\t\t}\n\t\tString[] arr = str.split(\",\");\n\t\tfor (String s : arr) {\n\t\t\ts = s.trim();\n\t\t\tif(!isEmpty(s)) {\n\t\t\t\tlist.add(s);","sourceCodeStart":580,"sourceCodeEnd":616,"githubUrl":"https://github.com/dromara/Sa-Token/blob/ac2c7f6e94a78573cf0bcb932dd8b04e68fad189/sa-token-core/src/main/java/cn/dev33/satoken/util/SaFoxUtil.java#L580-L616","documentation":"SaFoxUtil.decoderUrl wraps URLDecoder.decode(url, \"UTF-8\") and converts UnsupportedEncodingException into SaTokenException code 12104. Like its encode counterpart, UTF-8 is mandated by the Java platform spec, so this branch is effectively unreachable on any standard JVM. Note it does NOT catch IllegalArgumentException, which is what malformed '%' sequences in the input actually raise.","triggerScenarios":"Only a non-conforming runtime lacking UTF-8 could trigger 12104; decoding a malformed encoded string instead throws IllegalArgumentException from URLDecoder, which propagates unwrapped.","commonSituations":"Never observed in practice; developers searching error code 12104 in logs are usually actually seeing IllegalArgumentException from bad percent-encoding elsewhere in the stack.","solutions":["Verify JDK vendor/version if this truly fires; otherwise treat as unreachable","If URL decoding fails in practice, look for IllegalArgumentException from invalid '%' sequences and sanitize the input instead"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// guard against the *real* decode failure: malformed '%' sequences\nif (url != null && url.matches(\".*%(?![0-9a-fA-F]{2}).*\")) {\n    // clean or reject before URLDecoder runs\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["No handling needed for code 12104 on standard JVMs","Guard inputs against stray '%' characters instead — that failure surfaces as IllegalArgumentException, not this code"],"tags":["sa-token","url-decoding","unreachable","utilities"],"backgroundTag":null,"analyzedSha":"ac2c7f6e94a78573cf0bcb932dd8b04e68fad189","analyzedAt":"2026-08-14T14:36:10.271Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}