Lines 18-24
Link Here
|
18 |
* You should have received a copy of the GNU General Public License along |
18 |
* You should have received a copy of the GNU General Public License along |
19 |
* with this program; if not, write to the Free Software Foundation, Inc., |
19 |
* with this program; if not, write to the Free Software Foundation, Inc., |
20 |
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
20 |
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
21 |
*/ |
21 |
THIS FILE WAS PATCHED WITH ISO8859-2 PATCH FOR EVOLUTION CONDUITS */ |
22 |
|
22 |
|
23 |
#ifdef HAVE_CONFIG_H |
23 |
#ifdef HAVE_CONFIG_H |
24 |
#include <config.h> |
24 |
#include <config.h> |
Lines 26-38
Link Here
|
26 |
|
26 |
|
27 |
#include <stdlib.h> |
27 |
#include <stdlib.h> |
28 |
#include <string.h> |
28 |
#include <string.h> |
|
|
29 |
#include <stdio.h> |
29 |
#include "pi-util.h" |
30 |
#include "pi-util.h" |
30 |
|
31 |
|
31 |
#ifdef HAVE_ICONV |
32 |
#ifdef HAVE_ICONV |
32 |
#include <iconv.h> |
33 |
#include <iconv.h> |
33 |
#endif |
34 |
#endif |
34 |
|
35 |
|
35 |
#define PILOT_CHARSET "CP1252" |
36 |
#define PILOT_CHARSET "ISO8859-2" |
36 |
|
37 |
|
37 |
/*********************************************************************** |
38 |
/*********************************************************************** |
38 |
* |
39 |
* |
Lines 51-61
Link Here
|
51 |
int bytes, char **ptext) |
52 |
int bytes, char **ptext) |
52 |
{ |
53 |
{ |
53 |
#ifdef HAVE_ICONV |
54 |
#ifdef HAVE_ICONV |
54 |
char *ib, |
55 |
|
|
|
56 |
char *ib, |
55 |
*ob; |
57 |
*ob; |
56 |
iconv_t cd; |
58 |
iconv_t cd; |
57 |
size_t ibl, obl; |
59 |
size_t ibl, obl; |
58 |
|
60 |
|
|
|
61 |
|
59 |
cd = iconv_open(PILOT_CHARSET, charset); |
62 |
cd = iconv_open(PILOT_CHARSET, charset); |
60 |
if (!cd) |
63 |
if (!cd) |
61 |
return -1; |
64 |
return -1; |
Lines 65-77
Link Here
|
65 |
ib = (char *)text; |
68 |
ib = (char *)text; |
66 |
*ptext = ob = malloc(obl); |
69 |
*ptext = ob = malloc(obl); |
67 |
|
70 |
|
68 |
if (iconv(cd, &ib, &ibl, &ob, &obl) == -1) |
71 |
iconv(cd, &ib, &ibl, &ob, &obl); |
69 |
return -1; |
|
|
70 |
*ob = '\0'; |
72 |
*ob = '\0'; |
71 |
|
73 |
|
72 |
iconv_close(cd); |
74 |
iconv_close(cd); |
73 |
|
75 |
|
74 |
return 0; |
76 |
return 0; |
|
|
77 |
|
75 |
#else |
78 |
#else |
76 |
return -1; |
79 |
return -1; |
77 |
#endif |
80 |
#endif |
Lines 94-104
Link Here
|
94 |
int bytes, char **text) |
97 |
int bytes, char **text) |
95 |
{ |
98 |
{ |
96 |
#ifdef HAVE_ICONV |
99 |
#ifdef HAVE_ICONV |
|
|
100 |
|
97 |
char *ib, |
101 |
char *ib, |
98 |
*ob; |
102 |
*ob; |
99 |
iconv_t cd; |
103 |
iconv_t cd; |
100 |
size_t ibl, obl; |
104 |
size_t ibl, obl; |
101 |
|
105 |
|
102 |
cd = iconv_open(charset, PILOT_CHARSET); |
106 |
cd = iconv_open(charset, PILOT_CHARSET); |
103 |
if (!cd) |
107 |
if (!cd) |
104 |
return -1; |
108 |
return -1; |
Lines 108-120
Link Here
|
108 |
ib = (char *)ptext; |
112 |
ib = (char *)ptext; |
109 |
*text = ob = malloc(obl); |
113 |
*text = ob = malloc(obl); |
110 |
|
114 |
|
111 |
if (iconv(cd, &ib, &ibl, &ob, &obl) == -1) |
115 |
iconv(cd, &ib, &ibl, &ob, &obl); |
112 |
return -1; |
|
|
113 |
*ob = '\0'; |
116 |
*ob = '\0'; |
114 |
|
117 |
|
115 |
iconv_close(cd); |
118 |
iconv_close(cd); |
116 |
|
119 |
|
117 |
return 0; |
120 |
return 0; |
|
|
121 |
|
118 |
#else |
122 |
#else |
119 |
return -1; |
123 |
return -1; |
120 |
#endif |
124 |
#endif |