> The question is: should the LCL use the 'native' string type and let the
> applications write three times the code. Or should the LCL use UTF-8 and
> map internally in the interfaces and let the applications write once and
> compile anywhere.
Maybe BOTH STUFF.
There are some O.S.'es that support some kind of Unicode, others no.
The ideal scenario will be that Unicode was supported by the O.S.
(files, functions A.P.I.) and that programs just use that support.
Maybe we could have 2 sets of libraries, one for native support
and other for non-native support and wrapped them in a library:
-----------------------------
MyProgram.pas
-----------------------------
program MyProgram;
uses
(* System, *)
Unicode,
Crt;
{#define NativeUnicode}
var
F: File of WideString;
S, D: WideString;
begin
AssignFile(F, 'MyUnicodeFile.txt');
Reset(F);
while (not EoF(F)) do
begin
ReadLn(F, S);
D := Unicode.Uppercase(S);
WriteLn(Crt, D);
end;
Close(F);
end.
-----------------------------
-----------------------------
Unicode.pas
-----------------------------
unit Unicode;
interface
(*
type
WideString = ...;
// defined by compiler
*)
implementation
uses
{#ifdef NativeUnicode}
Native,
{#else}
NonNative,
{#endif} (*NativeUnicode*)
;
function Uppercase(const Value: widestring);
begin
{#ifdef NativeUnicode}
Native.ToUpper(pchar(Value), pchar(Result), SizeOf(Value));
{#else}
Result := NonNative.Uppercase(Value);
{#endif} (*NativeUnicode*)
end;
end.
-----------------------------
Any toughts.
-----
Marco Aurelio Ramirez Carrillo
[EMAIL PROTECTED] [.mx]
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives