[fpc-devel] ansistrings and widestrings

peter green plugwash at bircd.org
Wed Jan 5 18:04:06 CET 2005


i found something slightly worrying in that code
  @-8  : SizeInt for reference count;
  @-4  : SizeInt for size;
  @    : String + Terminating #0;
a Sizeint isn't always 4 bytes!!

> -----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);
> 
> Michael.
> >
> > > -----Original Message-----
> > > From: fpc-devel-bounces at lists.freepascal.org
> > > [mailto:fpc-devel-bounces at lists.freepascal.org]On Behalf Of Alexey
> > > Barkovoy
> > > Sent: 05 January 2005 07:36
> > > To: FPC developers' list
> > > Subject: Re: [fpc-devel] ansistrings and widestrings
> > >
> > >
> > > > if i do ansistringvar := widestringvar or widestringvar := 
> ansistringvar
> > > > what does the compiler do?
> > > >
> > > > 1: use the systems default encoding (if so obtained from where?)
> > > > 2: use utf-8
> > > > 3: use iso-8859-1
> > > > 4: use something else?
> > > >
> > > > furthermore if the encoding used is one not capable of 
> representing all
> > > > unicode code points what are the reduction rules used in the
> > > conversion from
> > > > widestring to ansistring?
> > >
> > > Compiler internally uses Wide2AnsiMoveProc and Ansi2WideMoveProc
> > > functions which
> > > can be reassigned by user. Currently their are just maping lower
> > > 128 chars in
> > > one representation to other. On Windows there are system
> > > functions that can be
> > > used to do conversion: MultiByteToWideChar and
> > > WideCharToMultiByte - these
> > > functions can take into account specified or globally set code page.
> > >
> > >
> > > _______________________________________________
> > > fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> > > http://lists.freepascal.org/mailman/listinfo/fpc-devel
> >
> >
> > _______________________________________________
> > fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> > http://lists.freepascal.org/mailman/listinfo/fpc-devel
> >
> 
> _______________________________________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-devel




More information about the fpc-devel mailing list