head	1.10;
access;
symbols
	RELEASE_8_3_0:1.9
	RELEASE_9_0_0:1.6
	RELEASE_7_4_0:1.6
	RELEASE_8_2_0:1.6
	RELEASE_6_EOL:1.5
	RELEASE_8_1_0:1.5
	RELEASE_7_3_0:1.5
	RELEASE_8_0_0:1.5
	RELEASE_7_2_0:1.4
	RELEASE_7_1_0:1.4
	RELEASE_6_4_0:1.4
	RELEASE_5_EOL:1.2;
locks; strict;
comment	@# @;


1.10
date	2012.05.15.10.12.36;	author sunpoet;	state Exp;
branches;
next	1.9;

1.9
date	2012.01.16.12.51.02;	author sunpoet;	state Exp;
branches;
next	1.8;

1.8
date	2012.01.13.14.33.57;	author scheidell;	state Exp;
branches;
next	1.7;

1.7
date	2012.01.13.13.43.37;	author scheidell;	state Exp;
branches;
next	1.6;

1.6
date	2011.01.21.16.52.50;	author sunpoet;	state Exp;
branches;
next	1.5;

1.5
date	2009.06.07.17.24.26;	author dhn;	state Exp;
branches;
next	1.4;

1.4
date	2008.07.02.23.02.46;	author wxs;	state Exp;
branches;
next	1.3;

1.3
date	2008.06.18.17.36.53;	author leeym;	state Exp;
branches;
next	1.2;

1.2
date	2008.04.06.08.34.57;	author rafan;	state Exp;
branches;
next	1.1;

1.1
date	2008.02.16.20.13.28;	author alepulver;	state Exp;
branches;
next	;


desc
@@


1.10
log
@- Fix patch for unrar 4.20 Beta 1

Approved by:	maintainer (implicit)
@
text
@--- cmddata.cpp.orig	2011-01-04 20:28:47.000000000 +0800
+++ cmddata.cpp	2011-01-18 11:21:35.000000000 +0800
@@@@ -153,6 +153,34 @@@@
   if (Test && Extract)
     Test=false;        // Switch '-t' is senseless for 'X', 'E', 'P' commands.
   BareOutput=(CmdChar=='L' || CmdChar=='V') && Command[1]=='B';
+#ifdef WITH_ICONV
+  if ( (encInt[0] != '\0') || (encExt[0] != '\0') ) {
+    char fullEncInt[ENC_MAXLEN + OPT_MAXLEN + 1];
+    char fullEncExt[ENC_MAXLEN + OPT_MAXLEN + 1];
+
+    strcpy(fullEncInt, encInt);
+    strcpy(fullEncExt, encExt);
+
+    if (encOpt[0] == '\0') strcpy(encOpt, OPT_DEFAULT);
+
+    if (encOpt[0] != '\0') {
+      strcat(fullEncInt, "//"); strcat(fullEncInt, encOpt);
+      strcat(fullEncExt, "//"); strcat(fullEncExt, encOpt);
+    }
+
+    h_E2I = iconv_open(fullEncInt, encExt);
+    h_I2E = iconv_open(fullEncExt, encInt);
+
+    if ( (h_E2I == (iconv_t)(-1)) || (h_I2E == (iconv_t)(-1)) ) {
+      if (h_E2I != (iconv_t)(-1)) iconv_close(h_E2I);
+      if (h_I2E != (iconv_t)(-1)) iconv_close(h_I2E);
+      mprintf(St(MIconvCannotOpen), encInt, encExt, encOpt);
+    }
+  } else {
+    h_E2I = (iconv_t)(-1);
+    h_I2E = (iconv_t)(-1);
+  }
+#endif
 }
 
 
@@@@ -877,6 +905,22 @@@@
           break;
       }
       break;
+#ifdef WITH_ICONV
+    case 'L':
+      switch(toupper(Switch[1]))
+      {
+	case 'L':
+	  strncpy(encExt, Switch+2, sizeof(encExt)-1);
+	  break;
+        case 'A':
+	  strncpy(encInt, Switch+2, sizeof(encInt)-1);
+	  break;
+	case 'O':
+	  strncpy(encOpt, Switch+2, sizeof(encOpt)-1);
+	  break;
+      }
+      break;
+#endif
 #ifndef GUI
     case '?' :
       OutHelp();
@@@@ -955,7 +999,11 @@@@
     MCHelpSwm,MCHelpSwAC,MCHelpSwAD,MCHelpSwAI,MCHelpSwAP,
     MCHelpSwCm,MCHelpSwCFGm,MCHelpSwCL,MCHelpSwCU,
     MCHelpSwDH,MCHelpSwEP,MCHelpSwEP3,MCHelpSwF,MCHelpSwIDP,MCHelpSwIERR,
-    MCHelpSwINUL,MCHelpSwIOFF,MCHelpSwKB,MCHelpSwN,MCHelpSwNa,MCHelpSwNal,
+    MCHelpSwINUL,MCHelpSwIOFF,MCHelpSwKB,
+#ifdef WITH_ICONV
+    MCHelpSwLA,MCHelpSwLL,MCHelpSwLO,
+#endif
+    MCHelpSwN,MCHelpSwNa,MCHelpSwNal,
     MCHelpSwO,MCHelpSwOC,MCHelpSwOR,MCHelpSwOW,MCHelpSwP,
     MCHelpSwPm,MCHelpSwR,MCHelpSwRI,MCHelpSwSL,MCHelpSwSM,MCHelpSwTA,
     MCHelpSwTB,MCHelpSwTN,MCHelpSwTO,MCHelpSwTS,MCHelpSwU,MCHelpSwVUnr,
--- global.hpp.orig	2011-01-04 20:28:47.000000000 +0800
+++ global.hpp	2011-01-18 11:21:35.000000000 +0800
@@@@ -9,6 +9,19 @@@@
 
 EXTVAR ErrorHandler ErrHandler;
 
+#ifdef WITH_ICONV
 
+#define OPT_DEFAULT "IGNORE"	/* ignore unrepresentable chars */
+
+#define ENC_MAXLEN 32		/* encoding name maximum length */
+#define OPT_MAXLEN 9		/* strlen("TRANSLIT") */
+
+EXTVAR iconv_t h_E2I;			/* ExtToInt handler */
+EXTVAR iconv_t h_I2E;			/* IntToExt handler */
+EXTVAR char encInt[ENC_MAXLEN];	/* internal (archive) encoding */
+EXTVAR char encExt[ENC_MAXLEN];	/* external (filesystem) encoding */
+EXTVAR char encOpt[OPT_MAXLEN];	/* encoding option (ignore/translit) */
+
+#endif
 
 #endif
--- loclang.hpp.orig	2012-05-02 17:34:19.000000000 +0800
+++ loclang.hpp	2012-05-15 15:25:33.520723073 +0800
@@@@ -7,7 +7,7 @@@@
 #define   MCopyright         "\nRAR %s   Copyright (c) 1993-%d Alexander Roshal   %d %s %d"
 #define   MRegTo             "\nRegistered to %s\n"
 #define   MShare             "\nTrial version             Type RAR -? for help\n"
-#define   MUCopyright        "\nUNRAR %s freeware      Copyright (c) 1993-%d Alexander Roshal\n"
+#define   MUCopyright        "\nUNRAR %s (iconv) freeware      Copyright (c) 1993-%d Alexander Roshal\n"
 #define   MBeta              "beta"
 #define   MMonthJan          "Jan"
 #define   MMonthFeb          "Feb"
@@@@ -321,7 +321,7 @@@@
 #define   MSyncScanError     "\nFile search errors, cannot synchronize archive"
 #define   MCorrectingName    "\nWARNING: Attempting to correct the invalid file name"
 #define   MUnpCannotMerge    "\nWARNING: You need to start extraction from a previous volume to unpack %s"
-#define   MUnknownOption     "\nERROR: Unknown option: %s"
+#define   MUnknownOption     "\nERROR: Unknown option: %s\n"
 #define   MSubHeadCorrupt    "\nERROR: Corrupt data header found, ignored"
 #define   MSubHeadUnknown    "\nWARNING: Unknown data header format, ignored"
 #define   MSubHeadDataCRC    "\nERROR: Corrupt %s data block"
@@@@ -349,6 +349,12 @@@@
 #define   MMaxPathLimit      "\nTotal path and file name length must not exceed %d characters"
 #define   MRecVolLimit       "\nTotal number of usual and recovery volumes must not exceed 255"
 #define   MVolumeNumber      "volume %d"
+#ifdef WITH_ICONV
+#define   MCHelpSwLA         "\n  la<encoding>  Archive internal filenames encoding"
+#define   MCHelpSwLL         "\n  ll<encoding>  Your locale encoding"
+#define   MCHelpSwLO         "\n  lo<option>    Encoding option {ignore,translit,<empty>}"
+#define   MIconvCannotOpen   "\nCannot open iconv to convert between '%s' and '%s' with option '%s'"
+#endif
 #define   MCannotDelete      "\nCannot delete %s"
 #define   MCalcCRC           "\nCalculating the control sum"
 #define   MTooLargeSFXArc    "\nWARNING: Too large SFX archive. Windows cannot run the executable file exceeding 4 GB."
--- os.hpp.orig	2011-01-04 20:28:47.000000000 +0800
+++ os.hpp	2011-01-18 11:21:35.000000000 +0800
@@@@ -192,6 +192,10 @@@@
 #include <utime.h>
 #include <locale.h>
 
+#ifdef WITH_ICONV
+#include <iconv.h>
+#endif
+
 #ifdef  S_IFLNK
 #define SAVE_LINKS
 #endif
--- strfn.cpp.orig	2011-01-04 20:28:47.000000000 +0800
+++ strfn.cpp	2011-01-18 11:29:00.000000000 +0800
@@@@ -22,23 +22,49 @@@@
 
 void ExtToInt(const char *Src,char *Dest)
 {
+#ifdef WITH_ICONV
+  static size_t ret;
+  ret = (size_t)(-1);
+  if (h_E2I != (iconv_t)(-1)) {
+    static size_t inbytesleft, outbytesleft;
+    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 */
 #ifdef _WIN_ALL
   CharToOemA(Src,Dest);
 #else
   if (Dest!=Src)
     strcpy(Dest,Src);
 #endif
+#endif /* !WITH_ICONV */
 }
 
 
 void IntToExt(const char *Src,char *Dest)
 {
+#ifdef WITH_ICONV
+  static size_t ret;
+  ret = (size_t)(-1);
+  if (h_I2E != (iconv_t)(-1)) {
+    static size_t inbytesleft, outbytesleft;
+    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 */
 #ifdef _WIN_ALL
   OemToCharA(Src,Dest);
 #else
   if (Dest!=Src)
     strcpy(Dest,Src);
 #endif
+#endif /* !WITH_ICONV */
 }
 
 
@


1.9
log
@- Fix build after removal of hardcoded CXX/CXXFLAGS

Submitted by:	sunpoet (myself)
Approved by:	Yar <yarodin@@gmail.com> (maintainer)
@
text
@d96 2
a97 2
--- loclang.hpp.orig	2011-01-04 20:28:47.000000000 +0800
+++ loclang.hpp	2011-01-18 11:21:35.000000000 +0800
d101 1
a101 1
 #define   MShare             "\nShareware version         Type RAR -? for help\n"
d107 1
a107 1
@@@@ -319,7 +319,7 @@@@
d116 1
a116 1
@@@@ -347,6 +347,12 @@@@
d121 4
a124 4
+#define MCHelpSwLA           "\n  la<encoding>  Archive internal filenames encoding"
+#define MCHelpSwLL           "\n  ll<encoding>  Your locale encoding"
+#define MCHelpSwLO           "\n  lo<option>    Encoding option {ignore,translit,<empty>}"
+#define MIconvCannotOpen     "\nCannot open iconv to convert between '%s' and '%s' with option '%s'"
@


1.8
log
@- upgrading from 4.00,5 to 4.10,5 failed due to upstream change in strnfn.cpp
- patch fixes this

PR:		ports/163882
Submitted by:	A.J. Kehoe IV (Nanoman)" <ibxht163@@nanoman.ca>
Approved by:	gabor (mentor, implicit)
@
text
@a128 16
--- makefile.unix.orig	2010-03-30 23:26:26.000000000 +0800
+++ makefile.unix	2011-01-18 11:21:35.000000000 +0800
@@@@ -11,6 +11,13 @@@@
 DEFINES=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
 STRIP=strip
 DESTDIR=/usr
+# iconv stuff. Remove #ICONV# to enable
+# where to get iconv.h
+CXXFLAGS+= -I$(LOCALBASE)/include
+# where to get libiconv.so*
+LIBS+= -L$(LOCALBASE)/lib -liconv
+# enable iconv stuff
+DEFINES+= -DWITH_ICONV
 
 # Linux using LCC
 #CXX=lcc
@


1.7
log
@- Didn't reinstall documentation/fceux.6 as intended.
- maintainer asked committer to submit the patch due to maintainer's schedule

PR:		ports/163510
Submitted by:	A.J. Kehoe IV (Nanoman)" <ibxht163@@nanoman.ca>
Approved by:	maintainer (timeout, 22 days), gabor (mentor, implicit)
@
text
@@


1.6
log
@- Update to 4.00 Beta 4
- LOCALBASE is already in MAKE_ENV

PR:		ports/154105
Submitted by:	sunpoet (myself)
Approved by:	Yar Odin <yarodin@@gmail.com> (maintainer)
Feature safe:	yes
@
text
@d176 1
a176 1
 #if defined(_WIN_ALL)
d200 1
a200 1
 #if defined(_WIN_ALL)
@


1.5
log
@- Fix build with custom LOCALBASE.
- Fix iconv dependency

PR:	ports/135326
Submitted by:	Yar Odin <yarodin@@gmail.com> (maintainer)
@
text
@d1 3
a3 3
--- cmddata.cpp	Tue Oct  4 11:57:54 2005
+++ cmddata.cpp	Mon Jan 16 18:06:24 2006
@@@@ -123,6 +123,34 @@@@
d5 1
a5 1
     Test=false;
d38 1
a38 1
@@@@ -746,6 +774,22 @@@@
d61 2
a62 2
@@@@ -938,7 +982,11 @@@@
     MCHelpSwm,MCHelpSwAC,MCHelpSwAD,MCHelpSwAP,
d74 2
a75 2
--- global.hpp	Tue Oct  4 11:57:54 2005
+++ global.hpp	Mon Jan 16 18:04:41 2006
d96 3
a98 3
--- loclang.hpp	Tue Oct  4 11:57:54 2005
+++ loclang.hpp	Mon Jan 16 18:04:41 2006
@@@@ -6,7 +6,7 @@@@
d107 1
a107 1
@@@@ -310,7 +310,7 @@@@
d116 1
a116 1
@@@@ -338,3 +338,9 @@@@
d126 5
a130 2
--- makefile.unix.orig	2008-10-09 17:43:06.000000000 +0400
+++ makefile.unix	2009-06-07 17:27:00.000000000 +0400
d145 3
a147 4

--- os.hpp	Tue Oct  4 11:57:54 2005
+++ os.hpp	Mon Jan 16 18:04:41 2006
@@@@ -169,6 +169,10 @@@@
d158 2
a159 2
--- strfn.cpp.orig      2007-09-10 17:49:28.000000000 +0600
+++ strfn.cpp   2008-04-03 21:15:08.000000000 +0600
d161 1
a161 1

d176 2
a177 2
 #if defined(_WIN_32)
   CharToOem(Src,Dest);
d184 2
a185 2


d200 2
a201 2
 #if defined(_WIN_32)
   OemToChar(Src,Dest);
d208 2
@


1.4
log
@Fix broken build.

PR:		ports/125040
Submitted by:	Sunpoet Po-Chuan Hsieh <sunpoet@@sunpoet.net>
Approved by:	Yar Odin <yarodin@@gmail.com> (maintainer)
@
text
@d126 2
a127 2
--- makefile.unix	2008-05-31 14:18:14.000000000 +0800
+++ makefile.unix	2008-06-27 17:03:22.459952295 +0800
d134 1
a134 1
+CXXFLAGS+= -I/usr/local/include
d136 1
a136 1
+LIBS+= -L/usr/local/lib -liconv
d142 1
@


1.3
log
@- update patch for unrar-3.80.b1 and unbreak this port
- fix typo

PR:		124720
Submitted by:	leeym
Approved by:	maintainer
@
text
@d126 3
a128 4
--- makefile.unix	Sat Apr 30 11:00:12 2005
+++ makefile.unix	Mon Jan 16 18:04:41 2006
@@@@ -10,6 +10,13 @@@@
 CXXFLAGS=-O2
d131 1
@


1.2
log
@- Fix Unicode support
- Add some notes

PR:		ports/122420
Submitted by:	Yarodin <yarodin at gmail.com> (maintainer)
@
text
@d61 3
a63 3
@@@@ -964,7 +920,11 @@@@
     MCHelpCmdT,MCHelpCmdV,MCHelpCmdX,MCHelpSw,MCHelpSwm,MCHelpSwAC,MCHelpSwAD,
     MCHelpSwAP,MCHelpSwAVm,MCHelpSwCm,MCHelpSwCFGm,MCHelpSwCL,MCHelpSwCU,
d71 1
a71 1
     MCHelpSwOp,MCHelpSwOm,MCHelpSwOC,MCHelpSwOR,MCHelpSwOW,MCHelpSwP,
@


1.1
log
@Add unrar-iconv: unrar with iconv support (as slave port).

PR:		ports/117290
Submitted by:	Yarodin <yarodin at gmail.com>
@
text
@d155 2
a156 2
--- strfn.cpp	Tue Oct  4 11:57:54 2005
+++ strfn.cpp	Mon Jan 16 18:04:41 2006
d158 1
a158 1
 
d166 2
a167 3
+
+    inbytesleft = strlen(Src);
+    outbytesleft = inbytesleft;
d169 1
d171 2
a172 2
+  if (ret == (size_t)(-1)) strcpy(Dest, Src);
+#else	/* !WITH_ICONV */
d179 1
a179 1
+#endif	/* !WITH_ICONV */
d181 2
a182 2
 
 
d190 2
a191 3
+
+    inbytesleft = strlen(Src);
+    outbytesleft = inbytesleft;
d193 1
d195 2
a196 2
+  if (ret == (size_t)(-1)) strcpy(Dest, Src);
+#else	/* !WITH_ICONV */
d203 1
a203 1
+#endif	/* !WITH_ICONV */
@

