Skip to content

Use JVM default file encoding as fallback #1868

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

balajirrao
Copy link
Contributor

@balajirrao balajirrao commented Apr 2, 2025

When the Shell is run with a file with .js extension, the content-type is determined to be text/javascript, which leads to the 8859_1 encoding to be used. AFAICT this is obsolete now. Change it to use the JVM default encoding.

When the Shell is run with a file with .js extension, the content-type
is determined to be text/javascript, which leads to 8859_1 encoding to be
used. AFAICT this is obsolete now. Change it to use the JVM default encoding.
@aardvark179
Copy link
Contributor

I'm not sure about this. Prior to OpenJDK 18 the default character set is not necessarily a great choice. It might be worth picking UTF-8 explicitly for consistency. Have a look at JEP 400, especially:

In JDK 17 and earlier, the default charset is determined when the Java runtime starts. On macOS, it is UTF-8 except in the POSIX C locale. On other operating systems, it depends upon the user's locale and the default encoding, e.g., on Windows, it is a codepage-based charset such as windows-1252 or windows-31j.

@balajirrao
Copy link
Contributor Author

balajirrao commented Apr 2, 2025

I'm not sure about this. Prior to OpenJDK 18 the default character set is not necessarily a great choice. It might be worth picking UTF-8 explicitly for consistency. Have a look at JEP 400, especially:

@aardvark179 Yeah, I wasn't too sure about it either. Your suggestion sounds reasonable; prior to OpenJDK 18, it wasn't configurable either (according to JEP 400).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants