[fpc-devel] Encoded AnsiString

Hans-Peter Diettrich DrDiettrich1 at aol.com
Sun Dec 29 17:53:38 CET 2013


Michael Van Canneyt schrieb:
> 
> 
> On Sun, 29 Dec 2013, Hans-Peter Diettrich wrote:

>>> This will be combined with the dotted unit filenames, to be Delphi 
>>> 2010+ compatible.
>>
>> <sigh.sigh>
>> How do I create source files for use with both versions?
> 
> What do you mean by this statement ?

I'm not familiar with dotted unit names, they seem not to be used in XE.
So I only can imagine something like conditionals around the different 
items in un/dotted environment, to keep "Classes" separate from 
"System.Classes"?

Are directories involved? If so, does the Delphi structure match the FPC 
tree structure?


>> Where can I jump in?
> 
> When I'm done I will release a version for testing to the public.

Fine :-)


>> How can a user request an string of a specific allocation size?
> 
> You should not.

Okay.


>> Another one:
>>
>> I've heard that a mix of encodings converts the (concatenated) output 
>> (RawByteString?) to CP_ACP, with possible losses. Is this correct?
> 
> Define "output" ?

s := SomeACPstr+SomeUTF8str+"äöü";

In XE I can concatenate ACP and UTF-8 strings and assign it to an OEM 
string without losses. Somebody said this will fail in FPC, on e.g.
   FindFirst(myPath+allfiles,faAnyFile,sr);
due to an (intermediate?) conversion of myPath+allfiles to CP_ACP.

Of course the string must be converted to CP_ACP if FindFirst expects 
exactly an AnsiString(0) argument, otherwise something is broken.

DoDi




More information about the fpc-devel mailing list