On Fri, 11 Jan 2008 18:30:04 +0300
"Vasily I. Volchenko" <[EMAIL PROTECTED]> wrote:

> Here is a patch to svn lazarus. It enables {%encoding xxx} mechanism.
> Some changes are not very good, but... It enables hack which allows
> to use cp1251/koi8r LFM in gtk2 pseudo UTF
> (Hint='{%encoding=cp1251}'). That hack works partially on win32.
> Anyway, it is good for translating old/win32 projects. Course, string
> constants in ShowMessage('.......') are bad.

Thanks.

Some notes:

lcl/lconvencoding.pas

+   {$ifndef LCLgtk}

The lcl directory has no LCLwidgetset flag, because it contains only
platform independent code. The Widgetsets should set a variable or the
LCL should ask the widgetset, but it should not contain any widgetset
dependent code.


You moved the test for {%encoding } in front of the test for BOM,
which means the {%encoding} could override the BOM. But this will only
work with lazarus. All other text editors and tools, including the
compiler, will use UTF-8 as encoding. That's why the
BOM should override the {%encoding} and therefore be tested first.


k:=pos('{'+'%encoding ',s);
This will find the string even in strings and comments.


I think the new feature should be enclosed in IFDEF EnableSrcEncoding
until it is well tested.


Mattias

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to