|
We should somehow backport some of the enhancements done in the Pharo launcher regarding encoding of environment variables. We have already studied possible alternatives with Pablo and Christophe and arrived to the conclusion:
API Proposal for OSEnvironment:
at getEnv : aVariableName
Gets the value of an environment variable called `aVariableName`
It is the system reponsibility to manage the encoding.
Rationale: A common denominator for all platforms providing an already decoded string, because windows does not (compared to *nix systems) provide a encoded byte representation of the value. Windows has instead its own wide string representation.
[optionally] rawAt getEnvRaw : anEncodedVariableName
Gets the value of an environment variable called `anEncodedVariableName` already encoded.
It is the user responsibility to encode and decode argument and return values in the encoding of this preference.
Rationale: Some systems may want to have the liberty to use different encodings, or even to put binary data in the variables.
[optionally] at getEnv : aVariableName encoding: anEncoding
Gets the value of an environment variable called `aVariableName` using `anEncoding` to encode/decode arguments and return values.
Rationale: *xes could use different encodings
Other Implementation details
VM primitives returning paths Strings should be carefuly managed to decode them (since they are actually disguised byte arrays).
Windows requires calling the right *Wide version of the functions from C, plus the correct encoding routine. This could be implemented as an FFI call or by modifying the VM to do it properly instead of calling the Ascii version
|
|
|
Priority: 4 – Would be nice
|
|
Status: Work Needed
|
|
Assigned to: Everyone
|
|
Milestone: Later
|
Go to Case
|
|