#1 2015-03-16 07:54:00

DigDiver
Member
Registered: 2013-04-29
Posts: 137

SynCommons SetExecutableVersion and unicode

I think that we should use unicode version of functions GetUserName and GetComputerName for Delphi 2009 + in procedure SetExecutableVersion:

procedure SetExecutableVersion(aMajor,aMinor,aRelease: integer);
var setVersion,i: integer;
{$ifdef MSWINDOWS}
    TmpSize: cardinal;
  {$ifdef unicode}
    Tmp : array[byte] of Char;
  {$else}
    Tmp: array[byte] of AnsiChar;
  {$endif}
{$endif}
...

and use GetUserNameW/GetComputerNameW for Unicode and  GetUserNameA/GetComputerNameA for non unicode version

Offline

#2 2015-03-16 08:16:40

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,207
Website

Re: SynCommons SetExecutableVersion and unicode

Indeed.
Here, we always use pure ASCII chars for host and user names (since it make it easier to work with, and enough in English - or French - use case), so the previous implementation expected that.

I've let SetExecutableVersion() handle Unicode characters in Host and User names, for all version of Delphi (also before Delphi 2009, since the variables are RawUTF8, so Unicode ready).
See http://synopse.info/fossil/info/e818c8f1bc

Thanks for the feedback!

Offline

Board footer

Powered by FluxBB