Subject | Re: ib_udf, fbudf & UTF-8 |
---|---|
Author | ma_golyo |
Post date | 2011-01-17T13:35:47Z |
Hi!
We are useing a lot of function from these UDFs, substr was just an example.
The followings has CSTRING in or out parameters :
lpad, rpad : UTF8 support? alternatives if not?
I assume that builtin function handles all kind of string correctly :
rtrim : builtin TRIM SQL function
strlen : builtin LENGTH SQL function
lpad, rpad : builtin LPAD, RPAD SQL function (we're currently support only fb 2.0.x, but these came form 2.1.x)
substr UDF and SUBSTRIGN builtin function has different syntax.
We are useing a lot of function from these UDFs, substr was just an example.
The followings has CSTRING in or out parameters :
lpad, rpad : UTF8 support? alternatives if not?
I assume that builtin function handles all kind of string correctly :
rtrim : builtin TRIM SQL function
strlen : builtin LENGTH SQL function
lpad, rpad : builtin LPAD, RPAD SQL function (we're currently support only fb 2.0.x, but these came form 2.1.x)
substr UDF and SUBSTRIGN builtin function has different syntax.
--- In firebird-support@yahoogroups.com, Paul Vinkenoog <paul@...> wrote:
>
> Hi,
>
> > Currently we're useing WIN1250/PXW_HUNDC. The DDL is the next :
> >
> > DECLARE EXTERNAL FUNCTION SUBSTR
> > CSTRING(32767),
> > SMALLINT,
> > SMALLINT
> > RETURNS CSTRING(32767) FREE_IT
> > ENTRY_POINT 'IB_UDF_substr' MODULE_NAME 'ib_udf';
> >
> > Does ib_udf and fbudf support UTF-8? If so, how to define?
>
> I think the question should be: does substr (which is in ib_udf only) support UTF-8?
>
> The answer is no. substr (and substrlen) work with bytes, not with characters.
>
> Use the internal function SUBSTRING, which works with every character set.
>
> http://www.firebirdsql.org/refdocs/langrefupd21-intfunc-substring.html
>
>
> HTH,
> Paul Vinkenoog
>