ora_ffi and character set?

From: Antti Järvinen <costello_at_iki.fi>
Date: 07 Jun 2002 16:22:36 +0300
Message-ID: <m3vg8vgr4z.fsf_at_muikku.baana.suomi.net>



Dear Sirs,

supposing I have in NT written a piece of code in C containing a function like this:
--

char *foobar(char *str_in, int *retcode) {

   ...
}
--

that is compiled and linked to a dll that in turn gets called from a form like this:
--

PACKAGE BODY form_foobar IS
FUNCTION ff_in_foobar(ff_handle ORA_FFI.FUNCHANDLETYPE,in_str IN varchar2, retcode IN OUT PLS_INTEGER)

                  RETURN varchar2;
                  PRAGMA interface(C, ff_in_foobar, 11265);
function in_foobar(in_str IN varchar2, retcode IN OUT PLS_INTEGER) return varchar2 IS BEGIN
  if ora_ffi.is_null_ptr(hand_foobar) = false then     RETURN(ff_in_foobar(hand_foobar,in_str,retcode));   end if ;
END;
function foobar(str IN varchar2) return binary_integer is  x binary_integer ;
 errmsg VARCHAR2(500) ;
begin
 errmsg := in_foobar(str, x) ;
 return x ;
end ;
begin
  hand_lib := ora_ffi.load_library(
  'c:\temp\','foobar.dll') ;
  if ora_ffi.is_null_ptr(hand_lib) = false then
    hand_foobar := ora_ffi.register_function(hand_lib, 'foobar',ora_ffi.c_std) ;      ora_ffi.register_return(hand_foobar ,ORA_FFI.C_CHAR_PTR);    
    ora_ffi.register_parameter(hand_foobar, ORA_FFI.C_CHAR_PTR) ;
    ora_ffi.register_parameter(hand_foobar, ORA_FFI.C_INT_PTR) ; 
  end if ;
end ;
--

and this pl/sql code is attached to a form that is run in a machine where NLS_LANG is set to finnish_finland.UTF8 (AL24UTFFSS is tried also) and I'd like to ask: what is the character encoding for str_in in that C function? I don't seem to grok it. It doesn't seem like multibyte nor wchar_t so what is it, then? UCS-2? No, I specifically said that NLS_LANG is UTF8. Does it matter? Forms version is 6.0, this has been tried on NT with american,finnish and simplified chinese locales. Is this documented anywhere?

--

Antti Järvinen, costello_at_iki.fi

            "concerto for two faggots and orchestra" Received on Fri Jun 07 2002 - 15:22:36 CEST

Original text of this message