From: R. R. <ren...@cp...> - 2001-06-19 08:45:13
|
I subscribed to list meanwhile, no need to CC to me... Chris Ridd wrote: > One point you might need to consider is that many of the underlying string > types used in BER (which is the ISO standard that describes how to encode > the LDAP protocol for network transmission) are fundamentally ASCII-based. > If you mess with that, you've broken LDAP and won't be able to talk to any > LDAP servers :-( Correct, and that's part of the problem already ;-(... > (Graham, Convert::ASN1's 'make test' should test that strings are being > encoded using the correct character sets. Testing "PrintableString" would > be a good start.) > > So basically everything that you pass into Net::LDAP objects *must* be > ASCII or UTF-8 (if you are using LDAPv3.) I know that. The question is, _where_ excatly do I need to convert (back and forth) ? > I really don't know anything at all about perl on the 390, so this might be > a stupid question: what character set is used in the variables in your > program? It's EBCDIC, which (in more "standardized" form) is "IBM-1047" (as opposed to "ISO8859-1", which is ASCII). > If they're EBCDIC, you *need* to ASCII-ify (or UTF-8-ify) them first. > Similarly, you *need* to EBCDIC-ify all values that come back from the LDAP > server, as they are either ASCII-based or UTF-8 (if you are using LDAPv3) That's what I want to do (or tried to do) using "iconv"... Here's what I did to convert: $ascii_data = `echo '$ebcdic_data' | iconv -f IBM-1047 -t ISO8859-1` or $ebcdic_data = `echo '$ascii_data' | iconv -f ISO8859-1 -t IBM-1047` There's also a C API iconv() routine (UNIX98), but that's trickier to use in perl... and it should make no difference, basically. The problem is, I'm searching for the correct portions of code within the Net::LDAP module _where_ I should convert _what_ !?! Anyhow, thanks for the answer ! Hope I'll get more input... Rene -- R. Reucher voice: +49/621/4803-174 COMPAREX GmbH, VL40 fax: +49/621/4803-141 Mannheimerstr. 105 e-mail: ren...@cp... D-68535 Edingen-Neckarhausen |