[Vm-dev] Encoding of path/file names in security plugin

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Thu Dec 27 16:05:35 UTC 2018


Hi all,
while reviewing compiler warnings via MSVC for WIN-64 SPUR VM, I saw that
we incorrectly pass a TCHAR * (via fromSqueak() function) to a function
(isAccessiblePathName) expecting a WCHAR * (that is UTF-16 encoded wide
char).

TCHAR is a facade, it might be char *, or it might be WCHAR *, depending on
-DUNICODE compiler flag, or #define UNICODE preprocessor macro.

fromSqueak() just copies the image-side ByteString to a null terminated
string. If -DUNICODE, it copies to a WCHAR *, but this only work for ASCII
strings.

I suggest to rather interpret every path passed to the VM as UTF-8 encoded,
and for that purpose I've committed a change to sqWin32Security.c.
https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/b52caab76f7f6b91c1f16d9037e0b0a43d968176

But I see that other platforms flavours (unix at least) require the same
kind of changes. Any thought before i proceeed?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20181227/8b1a722e/attachment.html>


More information about the Vm-dev mailing list