>You don't see the source code for function UTF8CharacterLength() I don't see which place gives AV (on pasting text), is it in this^^^ func, or not. I only see last stop at ...:=UTF8CharacterLength(). Then i removed this call and replaced it with ...:=Length(UTF8Decode(s)). now this crash gone. but new code is slower. -- Regards, Alexey