Yes, I also saw the *W variants, my initial reaction was that those would make more sense, but it is hard to see all consequences.
On 17 Apr 2018, at 10:49, Henrik Sperre Johansen <henrik.s.johansen@veloxit.no> wrote:
primitiveGetenv returns values in the current locale's code page on Windows; a value bound to ⬠returns a stings with single char 128 on MS1252 (western european) at least.
On windows, there are three versions of each api call with string parameters/returns; xxx (depending on UNICODE being defined, either resolves to *A or *W) xxxA (Ascii, or, more accurately, current code page)* xxxW (UTF-16)
IIRC, the intention is that primitives receiving/sending char* to the image will expect/return utf8, so a conversion macro before passing it on to the syscall would be necessary on Windows; I believe one exist already and is used in at least the file plugin primitives.
Cheers, Henry
* The windows FFI fallback used if primitive fails calls the *A version directly, and can be changed to call *W correctly, but there's a fair bit of wrapping fluff involved; https://youtu.be/Um41DPPs5ZA?list=PL843D1D545F9F52B6&t=1591
-- Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html