Recent

Author Topic: tEdit default text are chinese characters  (Read 4820 times)

Martin V

  • Full Member
  • ***
  • Posts: 139
tEdit default text are chinese characters
« on: April 07, 2011, 03:28:25 pm »
Hello,

in a big ported program project, I have a strange effect. If I have no caption/text assignment in the lfm file or in the source file, I get 10 chinese (?) characters as default for tEdit, tCombobox, tGroupbox and tMemo (see gif file attachment). Another project works fine, I don't see any relevant differences. Nearly the same lfm file works on the one project, and generates the chinese chars at the other project. The source files are in UTF8 format and the LFM file has no assignments. An assignment Caption = '' in the LFM file does not delete the chinese characters. I have no idea where to begin for searching. Thank you for every hint.

I have installed two daily builds the last week, no effect. OS is Win32 Vista.

Arbee

  • Full Member
  • ***
  • Posts: 223
Re: tEdit default text are chinese characters
« Reply #1 on: April 07, 2011, 08:01:27 pm »
Wild guess .....

Is one of the UTF8 files with Byte Order Marks and the other one without?

Not every program is able to interpret a UTF8-BOM file properly.
1.0/2.6.0  XP SP3 & OS X 10.6.8

Martin V

  • Full Member
  • ***
  • Posts: 139
Re: tEdit default text are chinese characters
« Reply #2 on: April 08, 2011, 12:38:30 pm »
Byte order marks (see Wikipedia) are two characters at the beginning of the text files, one should be $FF. Neither my *.pp file nor the *.lfm files have such preceding characters. The chinese characters are shown at runtime if NO caption/text has been set in the resource editor and NO assignment is in the source code.

Martin V

  • Full Member
  • ***
  • Posts: 139
Re: tEdit default text are chinese characters
« Reply #3 on: April 16, 2011, 03:38:09 pm »
Meanwhile, the problem has vanished.

I found a Windows API call in my program which returns a string parameter. I forgot to assign memory by using a e.g. array [0..1000] of char instead of using a pointer. It seems that Windows overwrites a memory area where the LCL language settings are located in. Lazarus does not find an error.

 

TinyPortal © 2005-2018