I have committed units for encoding agnostic code into LazUtils package in Lazarus trunk.
See:
http://wiki.freepascal.org/Better_Unicode_Support_in_Lazarus#CodePoint_functions_for_encoding_agnostic_code
It deals with CodePoints and supports Delphi, too. Please have a look.
Juha
