Quote from: arneolav on January 06, 2014, 06:34:37 pmFindInvalidUTF8CharacterDeprecated, see #LazUtils.LazUTF8 for replacements.What exactly is deprecated here?Lazutf8.FindInvalidUTF8Character certainly isn't AFAIK.Bart
FindInvalidUTF8CharacterDeprecated, see #LazUtils.LazUTF8 for replacements.
The LazUtf8 unit contains this function:Code: [Select]function FindInvalidUTF8Character(p: PChar; Count: PtrInt; StopOnNonASCII: Boolean = false): PtrInt;You can use that to find out if a string is properly UTF8 encoded (it'll return -1 in that case).Bart
function FindInvalidUTF8Character(p: PChar; Count: PtrInt; StopOnNonASCII: Boolean = false): PtrInt;
It seems that there was/is a function with a similar name FindInvalidUTF8Character in LCLProc unit, and now it is in LazUTF8 unit. Name wise it was moved from one unit to another.
LazUTF8.FindInvalidUTF8Character(pchar(Edit8.Text),length(Edit8.Text), False)
But why returns allways -1 ?