[fpc-pascal] Testing set membership for unicode chars

Marco van de Voort marcov at stack.nl
Mon Jan 21 09:32:41 CET 2013


In our previous episode, Paul Ishenin said:
> >
> > I am using fpc 2.6.0 and the '..' operator converts the data to a pascal
> > set, which is limited to 1 byte data.
> >
> > Is there another way?
> Delphi has CharInSet() function for this: 
> http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/delphivclwin32/SysUtils_CharInSet@AnsiChar@TSysCharSet.html
> 
> I don't remember whether we have it in FPC at the moment.

2.6.0 has it iirc, but before you point to that, it only checks the low
byte.  IOW it is a stop gap, not a solution for set of char in the unicode
world.

Since unicode printable characters are effectively strings, if you want a
pure set you will probably have to treat it as a hash or so.



More information about the fpc-pascal mailing list