pkgsrc/devel/libgphoto2/patches/patch-aa
sborrill 32c15ee126 Patch ptp code to work with (hopefully) all implementations of iconv,
including NetBSD in-tree, pkgsrc and glibc.
2007-03-19 08:42:04 +00:00

36 lines
1.3 KiB
Text

$NetBSD: patch-aa,v 1.5 2007/03/19 08:42:04 sborrill Exp $
--- camlibs/ptp2/library.c.orig 2007-03-16 13:18:01.000000000 +0000
+++ camlibs/ptp2/library.c 2007-03-16 13:18:01.000000000 +0000
@@ -58,6 +58,7 @@
* is always bigendian though, we would need to work around that
* too...
*/
+/*
#ifndef __GLIBC__
#define UCS_2_INTERNAL "UCS-2-INTERNAL"
#else
@@ -66,7 +67,7 @@
#endif
#define UCS_2_INTERNAL "UCS-2"
#endif
-
+*/
#include "ptp.h"
#include "ptp-bugs.h"
#include "ptp-private.h"
@@ -3696,8 +3697,12 @@
curloc = nl_langinfo (CODESET);
if (!curloc) curloc="UTF-8";
- camera->pl->params.cd_ucs2_to_locale = iconv_open(curloc, UCS_2_INTERNAL);
- camera->pl->params.cd_locale_to_ucs2 = iconv_open(UCS_2_INTERNAL, curloc);
+ camera->pl->params.cd_ucs2_to_locale = iconv_open(curloc, "UCS-2-INTERNAL");
+ if(camera->pl->params.cd_ucs2_to_locale == (iconv_t) -1))
+ camera->pl->params.cd_ucs2_to_locale = iconv_open(curloc, "UCS-2");
+ camera->pl->params.cd_locale_to_ucs2 = iconv_open("UCS-2-INTERNAL", curloc);
+ if(camera->pl->params.cd_locale_to_ucs2 == (iconv_t) -1))
+ camera->pl->params.cd_locale_to_ucs2 = iconv_open("UCS-2", curloc);
if ((camera->pl->params.cd_ucs2_to_locale == (iconv_t) -1) ||
(camera->pl->params.cd_locale_to_ucs2 == (iconv_t) -1)) {
gp_log (GP_LOG_ERROR, "iconv", "Failed to create iconv converter.\n");