aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrafan <rafan@FreeBSD.org>2008-04-06 16:34:57 +0800
committerrafan <rafan@FreeBSD.org>2008-04-06 16:34:57 +0800
commit5a4084eda320da4c36fc252990d4a19a63a0ea56 (patch)
tree1ccd707f8ef03f5f55b8100131bc7e897f14d0cb
parentbca876c3a2ce7ddc42b3f8507915de56ab055df2 (diff)
downloadfreebsd-ports-gnome-5a4084eda320da4c36fc252990d4a19a63a0ea56.tar.gz
freebsd-ports-gnome-5a4084eda320da4c36fc252990d4a19a63a0ea56.tar.zst
freebsd-ports-gnome-5a4084eda320da4c36fc252990d4a19a63a0ea56.zip
- Fix Unicode support
- Add some notes PR: ports/122420 Submitted by: Yarodin <yarodin at gmail.com> (maintainer)
-rw-r--r--archivers/unrar-iconv/Makefile2
-rw-r--r--archivers/unrar-iconv/files/patch-iconv34
2 files changed, 19 insertions, 17 deletions
diff --git a/archivers/unrar-iconv/Makefile b/archivers/unrar-iconv/Makefile
index 85ac71e31f7f..027171d42792 100644
--- a/archivers/unrar-iconv/Makefile
+++ b/archivers/unrar-iconv/Makefile
@@ -18,5 +18,7 @@ CONFLICTS= unrar-[0-9]* zh-unrar-[0-9]*
post-install:
@${ECHO_MSG} "===> Added iconv support, see new switches:"
@${ECHO_MSG} " la, ll and lo at \"unrar -?\""
+ @${ECHO_MSG} "===> REMEMBER!!!: Windows rar archives using old DOS encodings as internal encoding."
+ @${ECHO_MSG} " CP866 for russian lang for exmaple."
.include "${MASTERDIR}/Makefile"
diff --git a/archivers/unrar-iconv/files/patch-iconv b/archivers/unrar-iconv/files/patch-iconv
index 422bb9255dc5..78318007e629 100644
--- a/archivers/unrar-iconv/files/patch-iconv
+++ b/archivers/unrar-iconv/files/patch-iconv
@@ -152,10 +152,10 @@
#ifdef S_IFLNK
#define SAVE_LINKS
#endif
---- strfn.cpp Tue Oct 4 11:57:54 2005
-+++ strfn.cpp Mon Jan 16 18:04:41 2006
+--- strfn.cpp.orig 2007-09-10 17:49:28.000000000 +0600
++++ strfn.cpp 2008-04-03 21:15:08.000000000 +0600
@@ -22,23 +22,49 @@
-
+
void ExtToInt(const char *Src,char *Dest)
{
+#ifdef WITH_ICONV
@@ -163,23 +163,23 @@
+ ret = (size_t)(-1);
+ if (h_E2I != (iconv_t)(-1)) {
+ static size_t inbytesleft, outbytesleft;
-+
-+ inbytesleft = strlen(Src);
-+ outbytesleft = inbytesleft;
++ inbytesleft = strlen(Src)+1;
++ outbytesleft = NM;
+ ret = iconv(h_E2I, &Src, &inbytesleft, &Dest, &outbytesleft);
++ Dest[outbytesleft-inbytesleft]=NULL;
+ }
-+ if (ret == (size_t)(-1)) strcpy(Dest, Src);
-+#else /* !WITH_ICONV */
++ if (ret == (size_t)(-1)) strcpy(Dest, Src);
++#else /* !WITH_ICONV */
#if defined(_WIN_32)
CharToOem(Src,Dest);
#else
if (Dest!=Src)
strcpy(Dest,Src);
#endif
-+#endif /* !WITH_ICONV */
++#endif /* !WITH_ICONV */
}
-
-
+
+
void IntToExt(const char *Src,char *Dest)
{
+#ifdef WITH_ICONV
@@ -187,18 +187,18 @@
+ ret = (size_t)(-1);
+ if (h_I2E != (iconv_t)(-1)) {
+ static size_t inbytesleft, outbytesleft;
-+
-+ inbytesleft = strlen(Src);
-+ outbytesleft = inbytesleft;
++ inbytesleft = strlen(Src)+1;
++ outbytesleft = NM;
+ ret = iconv(h_I2E, &Src, &inbytesleft, &Dest, &outbytesleft);
++ Dest[outbytesleft-inbytesleft]=NULL;
+ }
-+ if (ret == (size_t)(-1)) strcpy(Dest, Src);
-+#else /* !WITH_ICONV */
++ if (ret == (size_t)(-1)) strcpy(Dest,Src);
++#else /* !WITH_ICONV */
#if defined(_WIN_32)
OemToChar(Src,Dest);
#else
if (Dest!=Src)
strcpy(Dest,Src);
#endif
-+#endif /* !WITH_ICONV */
++#endif /* !WITH_ICONV */
}