![]() |
Unicode Compiler Option
Kleine Frage
Muss man in den Optionen vom Copiler etwas einstellen oder irgendwelche Define im code eintragen damit Unicode auch auf verschiedenen Systemen(Sprachen) funktioniert ? Hab da jemand in Korea sitzen wenn ich ihm meine DLL schicke funktioniert Unicode nicht. Nur dann wenn er es selbst compiliert aud seinen System. gruss Emil |
Re: Unicode Compiler Option
Delphi wird erst mit der demnächst erscheinenden Delphi-Version ohne Fremdkomponenten unicodefähig
|
Re: Unicode Compiler Option
Zitat:
Danke schön. gruss Emil |
Re: Unicode Compiler Option
Die letzte OpenSource-Version der TNT-Unicode-Komponentensammlung lässt sich noch finden
![]() |
Re: Unicode Compiler Option
Zitat:
Delphi-Quellcode:
Das funktioniert ohne problem
function EncodeUTF8(const Source: WideString): string;
var Index, SourceLength, CChar: Cardinal; begin { Convert unicode to UTF-8 } Result := ''; Index := 0; SourceLength := Length(Source); while Index < SourceLength do begin Inc(Index); CChar := Cardinal(Source[Index]); if CChar <= $7F then Result := Result + Source[Index] else if CChar > $7FF then begin Result := Result + Char($E0 or (CChar shr 12)); Result := Result + Char($80 or ((CChar shr 6) and $3F)); Result := Result + Char($80 or (CChar and $3F)); end else begin Result := Result + Char($C0 or (CChar shr 6)); Result := Result + Char($80 or (CChar and $3F)); end; end; end; function ToUnicodeString(s: pchar): WideString; var pw1 : array[0..1024] of WideChar; nLen1, nLen2, nLen3 : integer; begin nLen1 := Length(s); nLen2 := length(pw1); nLen3 := MultiByteToWideChar(CP_OEMCP, MB_PRECOMPOSED, s, nLen1, @pw1[0], nLen2); if nLen3 > 0 then begin pw1[nLen3] := chr(0); // *** We should put chr(0) at the end of string Result := WideString(pw1); end else Result := ''; end; function StrToUTF8(s: pchar): string; var w_str : WideString; begin w_str := ToUnicodeString(s); if w_str <> '' then result := EncodeUTF8(w_str) else result := ''; end; Aber nur wenn es auf dem jeweiligen System compiliert wird. Was ist an der Komponente anders ? gruss Emil |
Re: Unicode Compiler Option
Es ist keine einzelne Komponente sondern eine Sammlung von vielen Standardkomponenten.
|
Re: Unicode Compiler Option
Zitat:
Soweit gehe ich dann doch nicht. trotzdem Danke für den Hinweis. Gruss Emil |
Re: Unicode Compiler Option
Warum, diese Version ist doch frei
|
Re: Unicode Compiler Option
Zitat:
Zitat:
|
Re: Unicode Compiler Option
Ja, aber bis zur Version 2.3.0 war die Sammlung OpenSource
![]() |
Alle Zeitangaben in WEZ +1. Es ist jetzt 03:33 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz