[Lazarus] Unicode support enabled for win32 with fpc 2.2.1 and higher

Mattias Gaertner nc-gaertnma at netcologne.de
Tue Apr 22 09:54:17 CEST 2008


On Tue, 22 Apr 2008 08:58:42 +0200
Luca Olivetti <luca at wetron.es> wrote:

> En/na Felipe Monteiro de Carvalho ha escrit:
> > On Mon, Apr 21, 2008 at 4:27 AM, Luca Olivetti <luca at wetron.es>
> > wrote:
> >>  Answering to myself: in my copy of lazarus ("ancient" snapshot
> >>  2008-06-23)/fpc those functions are defined in wstringh.inc,
> >> *not* in LCLIntf as the wiki says, and they simply call
> >> utf8encode/utf8decode
> > 
> > You are right. They were previously in LCLIntf, but were added to
> > the RTL.
> > 
> > UTF8Encode converts from utf-16 to utf-8
> > 
> > utf8decode converts from utf-8 to utf-16
> 
> And AnsiToUtf8/Utf8ToAnsi simply call Utf8Encode/Utf8Decode, so they
> end up doing the same ?!?!
> Maybe the difference lies in the automatic typecasting from
> widestring to ansistring?

Yes. A string given to widestring calls internally the widestring
manager and converts ansi to UCS2/UTF-16.
A string conversion manager with less overhead is planned.

 
> > You can use them if you are using widestrings.
> 
> I'm not (knowingly) using widestrings, but I think the system 
> function/methods I'm calling have an overloaded version that accepts 
> widestrings.



More information about the Lazarus mailing list