[Lazarus] substr return wrong string with some utf8 char

claude Pomalo claude.pomalo at free.fr
Thu Feb 10 11:27:45 CET 2011


hello

i use the substr function to get some truncated string.
these string are in french language  and sometimes contains "à" or "é" 
etc.. char
When these charaters are in the string the wrong substr is return
substr (pierre à feu,11) return 'pierre à  f' not 'pierre à fr'

length('à') return 2
utf8length('à') return 1

is a utf8Subst() like function exist?

thank
Claude






More information about the Lazarus mailing list