Hi Arno!

Of cource idea in this, allow enable change default codepage
About support old OS I'm not sure, you must decide itself, realy such computers 
no such more.
Also again about default parameters - what minimal Delphi Version ICS must 
support, defaults not supported with early versions of Delphi, but ICS support 
it's, except last ICS
Another aspect - for example I prefer use such functions not from library but 
coded itself in own code. It's my preferation, that not depend from internal 
realisation of any libraries.

Excuse for my English, I can read free, but write very poor, I believe you 
understand my English.

I very satisfied with ICS. For my needs I tried realize NNTP Server with Indy, 
result bad, with ICS I done it very easy for week. Now Indy and me uncompatible 
things.
ICS very good for professional work, simple, customizible and Delphi style. 
Indy is Unix style not for me.
I know ICS from first days, read this mailing list also from his birthday, but 
use only last year.


Best regards,
Anatoly Podgoretsky


----- Original Message ----- 
From: "Arno Garrels" <[EMAIL PROTECTED]>
To: "ICS support mailing" <[email protected]>
Sent: Wednesday, April 23, 2008 9:12 PM
Subject: Re: [twsocket] NTLM Unicode bug and lazy fix


Hello Anatoly,

> I think if no support old OS, then code can looks such

Ok, I shouldn't be lazy, I'll add support for windows 
playstation v0.1 alpha tomorrow as well ;-)

> Also may be need add addition default parameter CodePade?

Good idea to add an optional parameter to be able to specify
a certain codepage (if I read this correctly beween your lines?)
this parameter could default to the current codepage.

What do you think?

--
Arno Garrels [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html


> 
> function AnsiToUnicode(const AData: String): WideString;
> var
>     Len : Integer;
> begin
>     Len := MultiByteToWideChar(CP_ACP, 0, Pointer(AData),
> Length(AData), nil, 0); 
>     if Len > 0 then begin
>         SetLength(Result, Len);
>         MultiByteToWideChar(CP_ACP, 0, Pointer(AData), Length(AData),
> PWideChar(Result), Len); 
>     end
>     else
>         Result := '';
>     end;
> end;
> 
> Best regards,
> Anatoly Podgoretsky
> 
> 
> ----- Original Message -----
> From: "Arno Garrels" <[EMAIL PROTECTED]>
> To: "ICS support mailing" <[email protected]>
> Sent: Wednesday, April 23, 2008 7:59 PM
> Subject: [twsocket] NTLM Unicode bug and lazy fix
> 
> 
> 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
-- 
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
-- 
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

Reply via email to