[fpc-other] [fpc-pascal] FPC Graphics options?
Jürgen Hestermann
juergen.hestermann at gmx.de
Wed May 24 17:29:42 CEST 2017
Am 2017-05-24 um 14:02 schrieb wkitty42 at windstream.net:
> On 05/24/2017 12:54 AM, Ralf Quint wrote:
>> Well, the problem is that you can't use those handy Pascal strings that
>> much anymore these days. Ever since you need to use UTF8 to properly
>> represent textual context, this all has become one hell of a mess,
>> pretty leveling the playing field when it comes to handling such strings
>> with (Free)Pascalor C...
>
> quite true, my friend... quite true :)
I disagree!
You still know the byte(!) length of UTF-8 strings
and in many cases you don't need anything more.
If I search for the existence of an ASCII character
I can still iterate my string in a for loop:
for i := low(MyString) to high(MyString) do
begin
case MyString[i] of
'!' : do_something;
'a','A' : do_something_else;
end; // of case
end;
Works perfectly on UTF-8 strings.
And if it's coming to the number of glyphs in a string you will
have a hard time anyway because of diacrytics etc.
But I very seldom need the exact number of displayed glyphs.
And for these cases there are powerfull functions available in Free Pascal
to handle them.
More information about the fpc-other
mailing list