summaryrefslogtreecommitdiff
path: root/comms/synce-libsynce/patches/patch-aa
blob: 87b58c2173580ec89274246a1d5f4c11d24dac4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
$NetBSD: patch-aa,v 1.1.1.1 2005/10/13 15:00:13 wiz Exp $

--- lib/wstr.c.orig	2004-01-12 10:33:34.000000000 +0100
+++ lib/wstr.c
@@ -5,6 +5,7 @@
 #include "synce_config.h"
 #include <stdlib.h>
 #include <string.h>
+#include <errno.h>
 
 #if HAVE_LOCALE_H
 #include <locale.h>
@@ -35,7 +36,7 @@
 #endif
 
 
-#define wstr_WIDE   "UNICODELITTLE"
+#define wstr_WIDE   "ucs-2le"
 #define wstr_ASCII  "ISO_8859-1"
 #define wstr_UTF8   "UTF-8"
 
@@ -79,7 +80,7 @@ static char* wstr_to_x(LPCWSTR inbuf, co
   cd = iconv_open(code, wstr_WIDE);
 	if (INVALID_ICONV_HANDLE == cd)
 	{
-		wstr_error("iconv_open failed");
+		wstr_error("iconv_open(%s, %s) failed: %s", code, wstr_WIDE, strerror(errno));
 		return NULL;
 	}
 
@@ -147,7 +148,7 @@ static LPWSTR wstr_from_x(const char* in
 	cd = iconv_open(wstr_WIDE, code);
 	if (INVALID_ICONV_HANDLE == cd)
 	{
-		wstr_error("iconv_open failed");
+		wstr_error("iconv_open(%s, %s) failed: %s", code, wstr_WIDE, strerror(errno));
 		return NULL;
 	}