Added --disable-printucs2 configuration option to turn off Windows tag character encoding convertion using iconv.
This commit is contained in:
parent
b75c44e5be
commit
cbbcbd31fc
17
README
17
README
@ -44,15 +44,16 @@ Dependencies
|
||||
============
|
||||
|
||||
The following features are enabled by default and may *) require external
|
||||
libraries. They can be controlled through configure options.
|
||||
libraries. They can be controlled through configure options. See also
|
||||
'./configure --help'.
|
||||
|
||||
Feature Package Configure options
|
||||
------------------------- ------- ----------------------------
|
||||
PNG image support zlib --without-zlib
|
||||
--with-zlib=DIR
|
||||
National language support gettext --disable-nls
|
||||
Decoding Windows XP tags libiconv --without-libiconv-prefix
|
||||
--with-libiconv-prefix[=DIR]
|
||||
Feature Package Configure options
|
||||
-------------------------- ------- ----------------------------
|
||||
PNG image support zlib --without-zlib
|
||||
--with-zlib=DIR
|
||||
National language support gettext --disable-nls
|
||||
Converting Windows XP tags libiconv --disable-printucs2
|
||||
--with-libiconv-prefix[=DIR]
|
||||
|
||||
zlib http://www.zlib.net/
|
||||
gettext *) http://www.gnu.org/software/gettext/
|
||||
|
||||
@ -28,6 +28,9 @@
|
||||
/* Define to 1 if you have the `iconv' function. */
|
||||
#undef HAVE_ICONV
|
||||
|
||||
/* Define to 1 to enable conversion of UCS2 encoded Windows tags to UTF-8. */
|
||||
#undef HAVE_PRINTUCS2
|
||||
|
||||
#endif /* !EXV_COMMERCIAL_VERSION */
|
||||
|
||||
/* Define to `const' or to empty, depending on the second argument of `iconv'. */
|
||||
|
||||
@ -107,6 +107,23 @@ if test "$USE_LENSDATA" = "yes"; then
|
||||
AC_DEFINE(HAVE_LENSDATA,1)
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([whether to convert UCS2 encoded Windows tags with iconv ])
|
||||
AC_ARG_ENABLE(printucs2,
|
||||
[ --disable-printucs2 do not convert UCS2 encoded Windows tag to UTF-8 ],
|
||||
USE_PRINTUCS2=$enableval, USE_PRINTUCS2=yes)
|
||||
AC_MSG_RESULT($USE_PRINTUCS2)
|
||||
if test "$USE_PRINTUCS2" = "yes"; then
|
||||
AC_DEFINE(HAVE_PRINTUCS2,1)
|
||||
else
|
||||
# if NLS is also disabled, don't link with iconv
|
||||
# (since in some cases, AM_GNU_GETTEXT and/or AM_ICONV configure for this anyway)
|
||||
if test "$USE_NLS" = "no"; then
|
||||
unset LIBICONV
|
||||
unset LTLIBICONV
|
||||
fi
|
||||
fi
|
||||
|
||||
# Udi's hack to add libiconv to the Libs section in exiv2.pc
|
||||
if test "$enable_shared" = "no"; then
|
||||
EXV_LIB_STATIC=$LTLIBICONV
|
||||
else
|
||||
|
||||
@ -46,6 +46,9 @@
|
||||
/* Define to 1 if you have the `iconv' function. */
|
||||
# undef EXV_HAVE_ICONV
|
||||
|
||||
/* Define to 1 to enable conversion of UCS2 encoded Windows tags to UTF-8. */
|
||||
# undef EXV_HAVE_PRINTUCS2
|
||||
|
||||
#endif /* !EXV_COMMERCIAL_VERSION */
|
||||
|
||||
/* File path seperator */
|
||||
|
||||
@ -1677,7 +1677,7 @@ namespace Exiv2 {
|
||||
|
||||
std::ostream& printUcs2(std::ostream& os, const Value& value)
|
||||
{
|
||||
#ifdef EXV_HAVE_ICONV
|
||||
#if defined EXV_HAVE_ICONV && defined EXV_HAVE_PRINTUCS2
|
||||
bool go = true;
|
||||
iconv_t cd = (iconv_t)(-1);
|
||||
if (value.typeId() != unsignedByte) {
|
||||
@ -1726,9 +1726,9 @@ namespace Exiv2 {
|
||||
if (!go) {
|
||||
os << value;
|
||||
}
|
||||
#else // !EXV_HAVE_ICONV
|
||||
#else // !(EXV_HAVE_ICONV && EXV_HAVE_PRINTUCS2)
|
||||
os << value;
|
||||
#endif // EXV_HAVE_ICONV
|
||||
#endif // EXV_HAVE_ICONV && EXV_HAVE_PRINTUCS2
|
||||
return os;
|
||||
|
||||
} // printUcs2
|
||||
|
||||
Loading…
Reference in New Issue
Block a user