{"record":{"id":"77a133af51e32b39","repo":"quarkusio/quarkus","slug":"you-will-very-likely-need-support-for-codepage-cp1","errorCode":null,"errorMessage":"You will very likely need support for Codepage Cp1252 to connect to SQL Server","messagePattern":"You will very likely need support for Codepage Cp1252 to connect to SQL Server","errorType":"http","errorClass":"IllegalStateException","httpStatus":500,"severity":"critical","filePath":"integration-tests/jpa-mssql/src/main/java/io/quarkus/it/jpa/mssql/JPAFunctionalityTestEndpoint.java","lineNumber":35,"sourceCode":"import jakarta.ws.rs.core.MediaType;\n\nimport io.quarkus.narayana.jta.QuarkusTransaction;\n\n/**\n * Basic test running JPA with the MS SQL database.\n * The application can work in either standard JVM or in native mode.\n */\n@Path(\"/jpa-mssql/testfunctionality\")\n@Produces(MediaType.TEXT_PLAIN)\npublic class JPAFunctionalityTestEndpoint {\n\n    @Inject\n    EntityManager em;\n\n    @GET\n    public String test() throws IOException {\n        if (!Charset.isSupported(\"Cp1252\"))\n            throw new IllegalStateException(\"You will very likely need support for Codepage Cp1252 to connect to SQL Server\");\n\n        cleanUpData();\n\n        //Store some well known Person instances we can then test on:\n        QuarkusTransaction.requiringNew().run(() -> {\n            persistNewPerson(\"Gizmo\");\n            persistNewPerson(\"Quarkus\");\n            persistNewPerson(\"Hibernate ORM\");\n        });\n\n        //Load all persons and run some checks on the query results:\n        QuarkusTransaction.requiringNew().run(() -> {\n            CriteriaBuilder cb = em.getCriteriaBuilder();\n\n            CriteriaQuery<Person> cq = cb.createQuery(Person.class);\n            Root<Person> from = cq.from(Person.class);\n            cq.select(from).orderBy(cb.asc(from.get(\"name\")));\n            TypedQuery<Person> q = em.createQuery(cq);","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/integration-tests/jpa-mssql/src/main/java/io/quarkus/it/jpa/mssql/JPAFunctionalityTestEndpoint.java#L17-L53","documentation":"The MSSQL test endpoint requires the JVM to support the Cp1252 character set because the SQL Server JDBC driver/DB collation commonly needs it; if Charset.isSupported(\"Cp1252\") is false it throws this IllegalStateException before running any test logic. On truncated JDK images or non-standard runtimes (e.g. some compact/native builds) the CPIK charset module may be absent.","triggerScenarios":"Running the jpa-mssql integration tests on a JVM lacking the jdk.charsets module or a minimized/limited charset build (e.g. custom runtime image, some GraalVM setups).","commonSituations":"Custom/jlink-trimmed JDK without jdk.charsets; unusual Linux distro JDK packages; running tests with a restricted --limit-modules list.","solutions":["Use a full JDK that includes the jdk.charsets module (standard Temurin/Oracle/OpenJDK builds)","Remove --limit-module restrictions that exclude jdk.charsets","For native-image tests, ensure charsets are included (native-image.properties / -H:+AddAllCharsets or registering Cp1252)","Verify with a quick program printing Charset.isSupported(\"Cp1252\") before debugging further"],"exampleFix":"// before (jlink/custom runtime missing charsets)\njlink --add-modules java.se --output image  // ok, but custom limited lists drop jdk.charsets\n\n// after\njlink --add-modules java.se,jdk.charsets --output image","handlingStrategy":"validation","validationCode":"if (!Charset.isSupported(\"Cp1252\")) {\n    throw new IllegalStateException(\"Run on a full JDK including jdk.charsets\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use a complete standard JDK distribution (Temurin/Oracle) for MSSQL tests","Avoid --limit-module setups excluding jdk.charsets","For native builds, register/allow all charsets","Sanity-check Charset.isSupported(\"Cp1252\") in CI before the test phase"],"tags":["charset","mssql","jdbc","jvm"],"backgroundTag":"unsupported-charset-cp1252","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"}