{"record":{"id":"41ce1776e5af6636","repo":"dromara/Sa-Token","slug":"12103","errorCode":"12103","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":585,"sourceCode":"\t * @return 拼接后的url字符串\n\t */\n\tpublic static boolean isUrl(String str) {\n\t\tif(isEmpty(str)) {\n\t\t\treturn false;\n\t\t}\n        return str.toLowerCase().matches(URL_REGEX);\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 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 * 将指定字符串按照逗号分隔符转化为字符串集合","sourceCodeStart":567,"sourceCodeEnd":603,"githubUrl":"https://github.com/dromara/Sa-Token/blob/ac2c7f6e94a78573cf0bcb932dd8b04e68fad189/sa-token-core/src/main/java/cn/dev33/satoken/util/SaFoxUtil.java#L567-L603","documentation":"SaFoxUtil.encodeUrl wraps URLEncoder.encode(url, \"UTF-8\") and converts the theoretically possible UnsupportedEncodingException into SaTokenException code 12103. In practice this branch is dead code: every conforming JVM (including Java 8+) is required to support UTF-8, so the exception can essentially never occur. Code 12103 exists purely to satisfy checked-exception handling.","triggerScenarios":"Only if the runtime JDK does not support the charset name 'UTF-8' — impossible on standard JDK distributions; a tampered/incorrect JRE would be the sole case.","commonSituations":"Never observed in normal deployments; developers mainly encounter code 12103 while reading source or grepping for SaErrorCode meanings.","solutions":["Treat any occurrence as a broken runtime: verify the JDK vendor/version (java -version) and re-run on a standard JDK","No code change needed — do not add handling for this in business logic"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Do not write handling for this branch — UTF-8 always exists on standard JVMs","If it ever fires, treat the runtime JDK as broken and replace it"],"tags":["sa-token","url-encoding","unreachable","utilities"],"backgroundTag":null,"analyzedSha":"ac2c7f6e94a78573cf0bcb932dd8b04e68fad189","analyzedAt":"2026-08-14T14:36:10.271Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}