--- Begin Message ---On Thu, Jan 17, 2019 at 04:57:18PM +0100, Sven Van Caekenberghe wrote: > > > On 16 Jan 2019, at 23:23, Eliot Miranda <eliot.mira...@gmail.com> wrote: > > > > On Wed, Jan 16, 2019 at 2:37 AM Sven Van Caekenberghe <s...@stfx.eu> wrote: > > > > The image side is perfectly capable of dealing with platform differences > > in a clean/clear way, and at least we can then use the full power of our > > language and our tools. > > > Agreed. At the same time I think it is very important that we don't reply > on the FFI for environment variable access. This is a basic cross-platform > facility. So I would like to see the environment accessed through primitives, > but have the image place interpretation on the result of the primitive(s), > and have the primitive(s) answer a raw result, just a sequence of > uninterpreted > bytes. > > OK, I can understand that ENV VAR access is more fundamental than FFI > (although FFI is already essential for Pharo, also during startup). > > > VisualWorks takes this approach and provides a class UninterpretedBytes > > that the VM is aware of. That's always seemed like an ugly name and > > overkill to me. I would just use ByteArray and provide image level > > conversion from ByteArray to String, which is what I believe we have anyway. > > Right, bytes are always uninterpreted, else they would be something else. > We got ByteArray>>#decodedWith: and ByteArray>>#utf8Decoded and our ByteArray > inspector decodes automatically if it can. >Hi Sven, I am the author of the getenv primitives, and I am also sadly uninformed about matters of character sets and strings in a multilingual environment. The primitives answer environment variable variable values as ByteString rather than ByteArray. This made sense to me at the time that I wrote it, because ByteString is easy to display in an inspector, and because it is easily converted to ByteArray. For an American English speaker this seems like a good choice, but I wonder now if it is a bad decision. After all, it is also trivially easy to convert a ByteArray to ByteString for display in the image. Would it be helpful to have getenv primitives that answer ByteArray instead, and to let all conversion (including in OSProcess) be done in the image? Thanks, Dave
--- End Message ---
Re: [Pharo-dev] Better management of encoding of environment variables
David T. Lewis via Pharo-dev Thu, 17 Jan 2019 16:58:39 -0800
- [Pharo-dev] Better management of encoding of ... Guillermo Polito
- Re: [Pharo-dev] Better management of enc... Ben Coman
- Re: [Pharo-dev] Better management of... Guillermo Polito
- Re: [Pharo-dev] Better managemen... Guillermo Polito
- Re: [Pharo-dev] Better management of enc... Stephan Eggermont
- Re: [Pharo-dev] Better management of... Guillermo Polito
- Re: [Pharo-dev] Better managemen... Nicolas Cellier
- Re: [Pharo-dev] Better manag... Stephan Eggermont
- Re: [Pharo-dev] Better manag... Guillermo Polito
- Re: [Pharo-dev] Better ... Sven Van Caekenberghe
- Re: [Pharo-dev] Bet... David T. Lewis via Pharo-dev
- Re: [Pharo-dev]... Guillermo Polito
- Re: [Pharo-dev]... ducasse via Pharo-dev
- Re: [Pharo-dev]... Eliot Miranda
- Re: [Pharo-dev]... Sven Van Caekenberghe
- Re: [Pharo-dev]... David T. Lewis
- Re: [Pharo-dev] Bet... Ben Coman via Pharo-dev
- Re: [Pharo-dev]... Guillermo Polito
- Re: [Pharo-dev]... Sven Van Caekenberghe
- Re: [Pharo-dev]... Ben Coman
- Re: [Pharo-dev]... Guillermo Polito