From 29712efb58a9520824b4b0d7d1b9b9e2d1f59694 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Droz?= Date: Wed, 19 Dec 2012 02:55:28 +0100 Subject: [PATCH] ldif: removed ldif_fix_string() 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. --- filter.c | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/filter.c b/filter.c index c8b3d9e..ecbcfd9 100644 --- a/filter.c +++ b/filter.c @@ -503,8 +503,6 @@ export_file(char filtname[FILTNAME_LEN], char *filename) #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, ... @@ -789,8 +787,6 @@ ldif_parse_file(FILE *handle) continue; /* just skip the errors */ } - ldif_fix_string(value); - ldif_convert(item, type, value); xfree(line); @@ -802,19 +798,6 @@ ldif_parse_file(FILE *handle) 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 */ -- 2.39.2