Mark, yeah it looks fine to me. Rich would know this better anyway
because we were using ICU previously and then converted to iconv
when merging and iirc iconv stuff was contributed by Rich then.
On 26/01/2011 09:59, Mark Craig wrote:
> Thanks Rich,
>
> Anton, (if you are still following these discussions) does what I have
> done inline look like the right thing to be doing on Mac OS X?
>
> In mozilla/directory/c-sdk/ldap/clients/tools/convutf8.cpp, I made a
> small change based on your suggestion, Rich.
>
> /* Type used for the src parameter to iconv() (the 2nd parameter) */
> -#if defined(_HPUX_SOURCE) || defined(__GLIBC__)
> +#if defined(_HPUX_SOURCE) || defined(__GLIBC__) || defined(DARWIN)
>
> That fixed my compilation problem. Yet I found another issue with the binaries.
>
> $ cd /Users/mark/NetBeansProjects/mozilla/dist
> $ export DYLD_LIBRARY_PATH=/Users/mark/NetBeansProjects/mozilla/dist/Darwin9.8.0_DBG.OBJ/lib
> $ ./bin/ldapsearch -p 1389 -b dc=example,dc=com uid=user.0
> ldapsearch: conversion from 646 to UTF-8 is not supported
> ldapsearch: warning: no conversion of filter to UTF-8
> ldapsearch: conversion from 646 to UTF-8 is not supported
> ldapsearch: warning: no conversion of base DN to UTF-8
>
> So I made an additional change to convutf8.cpp. Here's the diff
> showing both changes.
>
> $ hg diff ldap/clients/tools/convutf8.cpp
> diff -r 3f7d52e53a9d c-sdk/ldap/clients/tools/convutf8.cpp
> --- a/c-sdk/ldap/clients/tools/convutf8.cpp Thu Jan 06 12:12:22 2011 +0000
> +++ b/c-sdk/ldap/clients/tools/convutf8.cpp Wed Jan 26 09:47:53 2011 +0100
> @@ -83,13 +83,15 @@
> #elif defined(_WIN32)
> #define LDAPTOOL_CHARSET_DEFAULT "windows-1252" /* Windows */
> #define LDAPTOOL_CHARSET_WINANSI "ANSI" /* synonym */
> +#elif defined(DARWIN)
> +#define LDAPTOOL_CHARSET_DEFAULT "UTF-8" /* Mac OS X */
> #else
> #define LDAPTOOL_CHARSET_DEFAULT "646" /* all others */
> #endif
>
> /* Type used for the src parameter to iconv() (the 2nd parameter) */
> -#if defined(_HPUX_SOURCE) || defined(__GLIBC__)
> -#define LDAPTOOL_ICONV_SRC_TYPE char ** /* HP/UX and glibc (Linux) */
> +#if defined(_HPUX_SOURCE) || defined(__GLIBC__) || defined(DARWIN)
> +#define LDAPTOOL_ICONV_SRC_TYPE char ** /* HP/UX, glibc (Linux), and
> Mac OS X */
> #else
> #define LDAPTOOL_ICONV_SRC_TYPE const char ** /* all others */
> #endif
>
> Now, after I compile again, at least ldapsearch seems to work.
>
> $ ./bin/ldapsearch -p 1389 -b dc=example,dc=com uid=user.0
> version: 1
> dn: uid=user.0,ou=People,dc=example,dc=com
> postalAddress: Aaccf Amar$01251 Chestnut Street$Panama City, DE 50369
> postalCode: 50369
> uid: user.0
> description: This is the description for Aaccf Amar.
> employeeNumber: 0
> initials: ASA
> givenName: Aaccf
> objectClass: person
> objectClass: inetorgperson
> objectClass: organizationalperson
> objectClass: top
> pager: +1 779 041 6341
> mobile: +1 010 154 3228
> cn: Aaccf Amar
> telephoneNumber: +1 685 622 6202
> sn: Amar
> street: 01251 Chestnut Street
> homePhone: +1 225 216 5900
> mail:
user.0@mail...
> l: Panama City
> st: DE
>
> Again, thanks for getting me unstuck. Hope you're having a good new year.
>
> Regards,
> Mark
_______________________________________________
dev-tech-ldap mailing list
dev-tech-ldap@list...
https://lists.mozilla.org/listinfo/dev-tech-ldap
opensubscriber is not affiliated with the authors of this message nor responsible for its content.