[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Fw: Do openldap client tool(ldapsearch etc.) support UTF-8?



At 11:06 PM 4/19/2005, ç½?å¿?å?? wrote:
>> > At 11:19 PM 4/18/2005, =?gb2312?B?wt7Wvrzh?= wrote:
>> > >I using a a telnet term that support UTF-8(I can show correctly me unicode txt) to slapdadd 
>> > >unicode ldif data and import successfully.
>> > >Using ldapbrowser to search openldap,the result is showed corectly,but not with ldapsearch.
>> > 
>> > ldapsearch(1) produces LDIF, a UTF-8 encoded Unicode
>> > file format.
>> > 
>> > >Do openldap client tool(ldapsearch etc.) support UTF-8?
>> > 
>> > Yes.  But they also support and utilize LDIF base64
>> > encoding option where that is either required or
>> > deemed more appropriate than raw data (that may or
>> > may not be UTF-8 encoded Unicode).
>> 
> sorry ,I cannot understand you.
> I import unicode.ldif  to openldap,which the desciption composed with unicode txt,
> ldapsearch show as "description:: VW5pY29kZea1i+ivlQ==",but ldapbrowser can get the correctly result

There is nothing incorrect about what ldapsearch(1) is showing.
You just need to realize that what ldapsearch(1) is showing
is an intermediate format, for interchanging data between
programs.  That implies that one might want to decode the value
for presentation to users.

ldapsearch(1) doesn't do this because, well, it's not indented
to provide a presentation interface.  However, its easy enough
for a wrapping script to convert the intermediate format to
a presentation format, but an exercise I leave to you.

>attribute(description) valude is show correctly in unicode.ldif:
><28 [pldap] :/export/home/pldap>cat unicode.ldif
># Organization for Example Corporation
>dn: dc=my-domain,dc=com
>objectClass: dcObject
>objectClass: organization
>dc: my-domain
>o: my-domain Corporation
>description: Unicode��
>
>attribute(description) valude is show uncorrectly by ldapsearch:
><29 [pldap] :/export/home/pldap>ldapsearch -x -LLL
>dn: dc=my-domain,dc=com
>objectClass: dcObject
>objectClass: organization
>dc: my-domain
>o: my-domain Corporation
>description:: VW5pY29kZea1i+ivlQ==

Again, ldapsearch(1) produces correct LDAP Data Interchange
Format output.


>> 
>> 
>> 
>> > 
>> > Kurt 
>> > 
>>