Skip Menu |

This queue is for tickets about the SAP-Rfc CPAN distribution.

Report information
The Basics
Id: 71778
Status: open
Priority: 0/
Queue: SAP-Rfc

People
Owner: Nobody in particular
Requestors: xrgtn [...] yandex.ru
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.55
Fixed in: (no value)



Subject: unicode table data is returned by SAP::Rfc with is_utf8 flag off
Hello, I send unicode table to RFC procedure and get another unicode table in reply (both are RFCTYPE_CHAR). Rows in reply table are mangled (I suspect they get promoted to "iso8859-1" by default, instead of "utf8"). IMO this is completely wrong for unicode RFCTYPE_CHAR data, because it's text, unicode text and it explicitly gets converted from "UTF-16LE" to "UTF-8" (alloc_iconv("UTF-16LE", "UTF-8")). Hence the result is utf8 string and should have appropriate flag set. Patch is attached. -- WBR, xrgtn
Subject: u16to8_SvUTF8_on.patch
--- Rfc.xs.orig 2011-10-19 15:24:18.000000000 +0300 +++ Rfc.xs 2011-10-19 15:28:03.000000000 +0300 @@ -748,6 +748,9 @@ SV* u16to8(char * string, int ilen) { my_iconv_t myiconvt = alloc_iconv("UTF-16LE", "UTF-8"); perl_str = u_doconv16to8str(myiconvt->iconv_handle, string, ilen, myiconvt->is_target_utf8); dealloc_iconv(myiconvt); +#ifdef SvUTF8_on + SvUTF8_on(perl_str); +#endif return perl_str; }
Hi - thanks for sending me in these patches. I have applied them and uploaded version 1.56 - however, I am not sure why you are not using sapnwrfc instead as it uses the latest SAP NW RFC SDK from SAP - http://search.cpan.org/~piers/sapnwrfc-0.32/sapnwrfc-cookbook.pod Cheers, Piers Harding. On Wed Oct 19 09:11:54 2011, http://openid.yandex.ru/xrgtn/ wrote: Show quoted text
> Hello, > > I send unicode table to RFC procedure and get another unicode table in > reply (both are RFCTYPE_CHAR). Rows in reply table are mangled (I > suspect they get promoted to "iso8859-1" by default, instead of
"utf8"). Show quoted text
> IMO this is completely wrong for unicode RFCTYPE_CHAR data, because
it's Show quoted text
> text, unicode text and it explicitly gets converted from "UTF-16LE" to > "UTF-8" (alloc_iconv("UTF-16LE", "UTF-8")). Hence the result is utf8 > string and should have appropriate flag set. > > Patch is attached.