[fpc-devel] ansistrings and widestrings

Alexey Barkovoy clootie at ixbt.com
Wed Jan 5 20:54:48 CET 2005


Well functions are called ANSI to unicode and vice versa. ANSI is always single 
byte; by unicode people usually refer to utf16, not multibyte encoding and both 
Delphi and FPC define WideString as double byte strings. So semantically 
functions do that is required. IMHO then assigning widestring to ansistring 
noone should expect multibyte encoded result. Then you need utf-8 you should 
call special functions.

----- Original Message ----- 
From: "peter green" <plugwash at bircd.org>
To: "FPC developers' list" <fpc-devel at lists.freepascal.org>
Sent: Wednesday, January 05, 2005 8:32 PM
Subject: RE: [fpc-devel] ansistrings and widestrings


> ok i see a MAJOR problem with the semantics of those functions.
>
> they assume that one widechar is equivilent to one ansichar (that is the
> source count of widechars will equal the destination count of ansichars or
> the source count of widechars will equal the destination count of
> ansichars).
>
> this is simply not the case for many encodings. (utf-8 sjis euc to name just
> a few)
>
>
>> -----Original Message-----
>> From: fpc-devel-bounces at lists.freepascal.org
>> [mailto:fpc-devel-bounces at lists.freepascal.org]On Behalf Of Michael Van
>> Canneyt
>> Sent: 05 January 2005 16:11
>> To: FPC developers' list
>> Subject: RE: [fpc-devel] ansistrings and widestrings
>>
>>
>> On Wed, 5 Jan 2005, peter green wrote:
>>
>> > where are theese default versions located in the code?
>> >
>>
>> In the inc directory of the rtl. wstrings.inc
>>
>> procedure Wide2AnsiMove(source:pwidechar;dest:pchar;len:SizeInt);
>> procedure Ansi2WideMove(source:pchar;dest:pwidechar;len:SizeInt);
>>





More information about the fpc-devel mailing list