Recent

Author Topic: Unicode or DEFAULT_CHARSET in Lazarus  (Read 14058 times)

inky

  • New Member
  • *
  • Posts: 41
    • github
Unicode or DEFAULT_CHARSET in Lazarus
« on: December 22, 2003, 03:20:26 pm »
Few months ago I made some examples of using Kylix for writing programs with national interface.
I want to use Lazarus for it, but didn't understand... charset in Lazarus is some digits like 1,2,3...
But charset in Kylix may be DEFAULT_CHARSET or fcsUnicode or something like this.
So, question is:
Which value should I write in Charset property for 'DEFAULT_CHARSET' and for 'fcsUnicode'
Thanx

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2583
Unicode or DEFAULT_CHARSET in Lazarus
« Reply #1 on: December 23, 2003, 03:14:54 pm »
Lazarus (at least on Linux) does not use the Characterset. What you see is Delphi/win32 compatebility. In delphi the editor fior the property shows the constants for these numbers.
From delphi:
  ANSI_CHARSET = 0;
  DEFAULT_CHARSET = 1;

At the moment I don't think unicode is fully sopported in Lazarus.
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

inky

  • New Member
  • *
  • Posts: 41
    • github
Unicode or DEFAULT_CHARSET in Lazarus
« Reply #2 on: December 23, 2003, 07:12:16 pm »
Quote from: "Marc"
 ANSI_CHARSET = 0;
  DEFAULT_CHARSET = 1;



I tried it... 1 is not work like DEFAULT_CHARSET.
Or I did something wring.
But don't think that I really made mistake.

Quote

At the moment I don't think unicode is fully sopported in Lazarus.


Unicode is not fully supported even in Kylix 3.
For example I had troubles with unicode submenus using Kuylix 3 with Red Hat 8.0
But using QT Designer on the same system - there is no trouble at all.
So, as I understand, Kylix use old libraries, not libraries, presented in RH 8.0, but libraries, presented in libborqt...
If anybody knoe something about unicode support in Lazarus... I need it very much.
And I think couse Lazarus link programs to GTK, and GTK now supports unicode, there is no big problem in it.
Anyway, I am very thankful to Lazarus and FreePascal Creators.
You already made a great deal guys, so my respects...

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2583
Unicode or DEFAULT_CHARSET in Lazarus
« Reply #3 on: December 24, 2003, 12:23:33 pm »
Quote from: "norayr"

Quote from: "Marc"
 
  ANSI_CHARSET = 0;
  DEFAULT_CHARSET = 1;


I tried it... 1 is not work like DEFAULT_CHARSET.
Or I did something wring.
But don't think that I really made mistake.


OK, It was a try. I would have been surprised if lazarus would have been doing something with it.

Quote

Quote

At the moment I don't think unicode is fully sopported in Lazarus.


Unicode is not fully supported even in Kylix 3.
For example I had troubles with unicode submenus using Kuylix 3 with Red Hat 8.0
But using QT Designer on the same system - there is no trouble at all.
So, as I understand, Kylix use old libraries, not libraries, presented in RH 8.0, but libraries, presented in libborqt...
If anybody knoe something about unicode support in Lazarus... I need it very much.
And I think couse Lazarus link programs to GTK, and GTK now supports unicode, there is no big problem in it.


Linux, X, gtk and gtk2 support UTF. That something like or part of Unicode (or the opther way around).  This is not the same as the unicode you know from win32.

OK all the widgets support UTF. If you have set your LANG environment var to something UTF8, the text you get from a textbox for instance is UTF8 encoded. Lazarus doesn't change anything of it. So for that you just can use it.
However when using UTF8 and gtk, there is a problem with decoding virtual keys in the Keydown and KeyUp events. The KeyPress event, won't fire for all keys generating an extended ASCII char. So thats why I decided that UTF8 and gtk is not supported.
If you don't need those events, your app will probably work.

Since the gtk2 interface is internally derived from the gtk interface, not all routines have been updated to support native gtk2. This also counts for the keyboard event routines (thats still on my todo list)

Please note that Lazarus itself (at least the editor) can't displlay UTF at the moment, so you have to create your strings like # sequences.
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

 

TinyPortal © 2005-2018