Recent

Author Topic: Text length in UTF8  (Read 10297 times)

typo

  • Hero Member
  • *****
  • Posts: 3051
Text length in UTF8
« on: February 26, 2010, 08:43:52 am »
What function should I use to get the correct length of a text in UTF8?

Thanks.

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1933
Re: Text length in UTF8
« Reply #1 on: February 26, 2010, 09:43:14 am »
unit LCLProc UTF8Length

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: Text length in UTF8
« Reply #2 on: February 26, 2010, 09:20:23 pm »
Is there any way to determine if the string is UTF-8 or not?

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: Text length in UTF8
« Reply #3 on: February 26, 2010, 10:41:24 pm »
By the way: Is there any way to set a text format in a SynEdit  to all text you load or paste on there?
« Last Edit: February 26, 2010, 10:43:14 pm by typo »

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1933
Re: Text length in UTF8
« Reply #4 on: February 26, 2010, 11:20:16 pm »
Is there any way to determine if the string is UTF-8 or not?

You can try this function in LConvEncoding

if GuessEncoding(s)=EncodingUTF8 then...


 

TinyPortal © 2005-2018