[Lazarus] substr return wrong string with some utf8 char

Vincent Snijders vincent.snijders at gmail.com
Thu Feb 10 11:46:39 CET 2011


2011/2/10 claude Pomalo <claude.pomalo at free.fr>:
> 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?
>
>

http://lazarus-ccr.sourceforge.net/docs/lcl/lclproc/utf8copy.html

Vincent




More information about the Lazarus mailing list