Subject Re: [firebird-support] Re: udf won't do what it should
Author Ivan Prenosil
> no, comparing was just an example..as i said earlier, what i need is a
> udf that searches for substring in my unicode_fss fields and replaces
> them with a different substring..so i was thinking that whether this
> replacing takes place byte by byte or character by character shouldnt
> in fact matter...

UNICODE_FSS is just older variant of UTF-8,
I think you can safely use Delphi functions like

function UTF8Decode(const S: UTF8String): WideString;
function UTF8Encode(const WS: WideString): UTF8String;
etc.

> only im not so sure whether a unicode string might
> have oll of a sudden contain a 0-byte in the middle of it,

Firebird can have binary zero as part of string, in which case
you have to choose appropriate handling (i.e. not pchar based functions).
Other than that, zero inside string means end of string,
i.e. unicode_fss string can contain zero byte in the middle
only if it is part of your data.

Ivan