Hello Arno,
I hope this is to resolve the "non-US regional settings AD login
problem", right? Because we are having problems with customers in
Europe and Asia with active directory auth.
Regards,
Gorkem Ates
On Wed, Apr 23, 2008 at 7:59 PM, Arno Garrels <[EMAIL PROTECTED]> wrote:
> Hello all,
>
> I stumbled across this function in (OverbyteIcs)NtlmMsg.pas today:
>
> function Unicode(const AData: String): String;
> var
> I, J : Integer;
> begin
> SetLength(Result, Length(AData) * 2);
> J := 1;
> for I := 1 to Length(AData) do begin
> Result[J] := AData[I];
> Inc(J);
> Result[J] := #0;
> Inc(J);
> end;
> end;
>
> This works only with ASCII characters (Basic Latin 0000–007F) reliable.
> This method would work with Latin-1 Supplement 0080–00FF reliable too if
> the OS would use codepage Latin-1 (ISO 8859-1), however there is no
> such codepage in Windows, even though Windows 1252 is rather similar to
> Latin-1 (ISO 8859-1).
>
> I think we must use MultiByteToWideChar() to convert Ansi to Unicode,
> that would work either if both client and server use the same codepage or
> if the server uses Unicode. But this doesn't work with Win9x.
>
> This is a lazy fix, since it doesn't use ConvertINetMultiByteToUnicode()
> which we could call in Win95 with IE v5.5 and later:
>
> {* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
> { Convert a text to a unicode text stored }
> function UnicodeOld(const AData: String): String;
> var
> I, J : Integer;
> begin
> SetLength(Result, Length(AData) * 2);
> J := 1;
> for I := 1 to Length(AData) do begin
> Result[J] := AData[I];
> Inc(J);
> Result[J] := #0;
> Inc(J);
> end;
> end;
>
>
> {* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
> { Convert a text to a unicode text stored } { A. Garrels}
> function Unicode(const AData: String): String;
> var
> Len : Integer;
> begin
> if Win32Platform = VER_PLATFORM_WIN32_WINDOWS then
> Result := UnicodeOld(AData)
> else begin
> Len := MultiByteToWideChar(CP_ACP, 0, Pointer(AData),
> Length(AData), nil, 0);
> if Len > 0 then begin
> Len := Len * SizeOf(WideChar);
> SetLength(Result, Len);
> MultiByteToWideChar(CP_ACP, 0, Pointer(AData), Length(AData),
> Pointer(Result), Len);
> end
> else
> Result := '';
> end;
> end;
>
>
> {* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
>
> What do you think?
>
> --
> Arno Garrels [TeamICS]
> http://www.overbyte.be/eng/overbyte/teamics.html
> --
> To unsubscribe or change your settings for TWSocket mailing list
> please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
> Visit our website at http://www.overbyte.be
>
--
Gorkem Ates
Fastream Technologies
Software IQ: Innovation & Quality
www.fastream.com | Email: [EMAIL PROTECTED] | Tel: +90-312-223-2830
Join IQWF Server Yahoo group at http://groups.yahoo.com/group/IQWFServer
Join IQ Reverse Proxy Yahoo group at
http://groups.yahoo.com/group/IQReverseProxy
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be