Welcome, Guest
Username: Password: Remember me
CodeTyphon Linux OS Development, discussions and problems
  • Page:
  • 1

TOPIC:

function Length not good 11 years 3 weeks ago #4691

  • zeljko
  • zeljko's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 207
  • Thank you received: 38
linux xubuntu 64
codetyphon 4.5

begin
ShowMessage(IntToStr(Length(('ž'))));
end;

message show 2
not good

the result is 1

Please Log in or Create an account to join the conversation.

Last edit: by zeljko.

function Length not good 11 years 3 weeks ago #4692

  • avra
  • avra's Avatar
  • Visitor
  • Visitor
You are dealing with UTF8, so:
Length(('a') = 1
Length(('ž') = 2
Length(('ж') = 2

but if you include lazutf8 unit then you get this:
Utf8Length(('a') = 1
Utf8Length(('ž') = 1
Utf8Length(('ж') = 1

forum.lazarus.freepascal.org/index.php/t...21576.html#msg121576
forum.lazarus.freepascal.org/index.php/t...30540.html#msg130540

Please Log in or Create an account to join the conversation.

Last edit: by avra.

function Length not good 11 years 3 weeks ago #4693

  • zeljko
  • zeljko's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 207
  • Thank you received: 38
units LCLProc

function Utf8Length

thanks avra

Please Log in or Create an account to join the conversation.

  • Page:
  • 1