WARNING: this will change the default output file
encoding when importing a LDIF input!
- An LDIF input of UTF-8 entries is base64-encoded (RFC)
str_parse_line() already supports that pretty well.
- But ldif_fix_string(), present since the initial
CVS revision of abook, forces the conversion of utf-8
wide-chars to latin1.
- And that's why iconv exists
=> so let's drop it unless someone complains for a good reason.
#include "ldif.h"
-static void ldif_fix_string(char *str);
-
/* During LDIF import we need more fields than the
ITEM_FIELDS of a *list_item. Eg: "objectclass"
to test valid records, ...
continue; /* just skip the errors */
}
- ldif_fix_string(value);
-
ldif_convert(item, type, value);
xfree(line);
return 0;
}
-static void
-ldif_fix_string(char *str)
-{
- int i, j;
-
- for(i = 0, j = 0; j < (int)strlen(str); i++, j++)
- str[i] = ( str[j] == (char)0xc3 ?
- (char) str[++j] + (char) 0x40 :
- str[j] );
-
- str[i] = 0;
-}
-
/*
* end of ldif import
*/