elharo opened a new pull request, #209: URL: https://github.com/apache/maven-script-interpreter/pull/209
Partially fixes #206. `ScriptRunner.executeRun` falls back to `new String(bytes)` (platform default charset) when no explicit encoding is set (ScriptRunner.java:205). This makes script content decoding host-dependent: on JDK versions before 18, the platform default varies by locale/OS, so the same project can behave differently across machines. This change replaces `new String(bytes)` with `new String(bytes, StandardCharsets.UTF_8)` so the fallback decoding is always UTF-8. The `setScriptEncoding` javadoc is updated to document the new default. Includes a Groovy test script (`utf8-test.groovy`) containing the non-ASCII string literal "café" and a test (`groovyUtf8ScriptShouldDecodeCorrectly`) that runs it via `ScriptRunner` and verifies the decoded output is correct. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
