public class EncodingEnvironmentUtil
extends java.lang.Object
Constructor and Description |
---|
EncodingEnvironmentUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
setLocaleEnvironmentIfMac(GeneralCommandLine commandLine)
Deprecated.
GeneralCommandLine now contains the variable by default
Sets default encoding on Mac if it's undefined.
On Mac default character encoding is defined by several environment variables: LC_ALL, LC_CTYPE and LANG. See details. Unfortunately, Mac OSX has a special behavior: These environment variables aren't passed to an IDE, if the IDE is launched from Spotlight. Unfortunately, even EnvironmentUtil.getEnvironment() doesn't have these variables.
As a result, no encoding environment variables are passed to Ruby/Node.js/Python/other processes that are launched from IDE.
Thus, these processes wrongly assume that the default encoding is US-ASCII.
The workaround this method applies is to set LC_CTYPE environment variable if LC_ALL, LC_CTYPE or LANG aren't set before. LC_CTYPE value is taken from "Settings | File Encodings". |
static void |
setLocaleEnvironmentIfMac(java.util.Map<java.lang.String,java.lang.String> env,
java.nio.charset.Charset charset)
Deprecated.
use
EnvironmentUtil.getEnvironmentMap()
Sets default encoding on Mac if it's undefined. |
@Deprecated public static void setLocaleEnvironmentIfMac(GeneralCommandLine commandLine)
EnvironmentUtil.getEnvironment()
doesn't have these variables.
As a result, no encoding environment variables are passed to Ruby/Node.js/Python/other processes that are launched from IDE.
Thus, these processes wrongly assume that the default encoding is US-ASCII.
The workaround this method applies is to set LC_CTYPE environment variable if LC_ALL, LC_CTYPE or LANG aren't set before. commandLine
- GeneralCommandLine instance@Deprecated public static void setLocaleEnvironmentIfMac(java.util.Map<java.lang.String,java.lang.String> env, java.nio.charset.Charset charset)
EnvironmentUtil.getEnvironmentMap()
Sets default encoding on Mac if it's undefined.