[fpc-devel] Controlling the output of the widestring manager

Daniël Mantione daniel.mantione at freepascal.org
Tue Nov 27 21:24:27 CET 2007



Op Tue, 27 Nov 2007, schreef Felipe Monteiro de Carvalho:

> On Nov 27, 2007 8:58 PM, Daniël Mantione <daniel.mantione at freepascal.org> wrote:
> > This function has a code page parameter, which allows you to specify
> > the code page you want to use?
> 
> umm ... I missread it and thougth that only the values on the table
> are possible =)
> 
> ok, so:
> 
> OutputFormat: TEncoding;
> 
> TEncoding = (eCurrentLocale, eUtf8, etc);
> 
> or something similar?

Yes, that looks okay. However, I would use the IANA "cs" aliases as 
identifier names. Perhaps also use the IBM or Microsoft code page number 
as binary value, so you would get:

Tencoding = (csASCII             := 367,
             csPC850Multilingual := 850,
             csUTF8              := 65001,
             {...}
            );

Think carefully about the design. One issue will for example be that not 
every OS will support any encoding, some error handling and detection 
functionality will be necessary. The Win32 and Unix API's won't always 
cooperate with any design you think of.

Daniël


More information about the fpc-devel mailing list