Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 129759
Collapse All | Expand All

(-)cdrtools-2.01.01.orig/include/unls.h (+10 lines)
Lines 26-31 Link Here
26
#include <prototyp.h>
26
#include <prototyp.h>
27
#endif
27
#endif
28
28
29
#ifdef USE_ICONV
30
#include <iconv.h>
31
#endif
32
29
#ifdef	__cplusplus
33
#ifdef	__cplusplus
30
extern "C" {
34
extern "C" {
31
#endif
35
#endif
Lines 40-45 Link Here
40
	unsigned char 	**unls_uni2cs;		/* Unicode -> Charset	*/
44
	unsigned char 	**unls_uni2cs;		/* Unicode -> Charset	*/
41
	struct unls_unicode *unls_cs2uni;	/* Charset -> Unicode	*/
45
	struct unls_unicode *unls_cs2uni;	/* Charset -> Unicode	*/
42
	struct unls_table *unls_next;		/* Next table		*/
46
	struct unls_table *unls_next;		/* Next table		*/
47
#ifdef USE_ICONV
48
	iconv_t iconv_d;
49
#endif
43
};
50
};
44
51
45
extern int		init_unls		__PR((void));
52
extern int		init_unls		__PR((void));
Lines 51-56 Link Here
51
extern void 		unload_unls		__PR((struct unls_table *));
58
extern void 		unload_unls		__PR((struct unls_table *));
52
extern struct unls_table *load_unls_default	__PR((void));
59
extern struct unls_table *load_unls_default	__PR((void));
53
extern int		init_unls_file		__PR((char * name));
60
extern int		init_unls_file		__PR((char * name));
61
#ifdef USE_ICONV
62
extern int		init_unls_iconv		__PR((char * name));
63
#endif
54
64
55
#ifdef	__cplusplus
65
#ifdef	__cplusplus
56
}
66
}
(-)cdrtools-2.01.01.orig/libunls/Targets (-1 / +2 lines)
Lines 39-42 Link Here
39
	nls_cp10029.c \
39
	nls_cp10029.c \
40
	nls_cp10079.c \
40
	nls_cp10079.c \
41
	nls_cp10081.c \
41
	nls_cp10081.c \
42
	nls_file.c
42
	nls_file.c \
43
	nls_iconv.c
(-)cdrtools-2.01.01.orig/libunls/libunls.mk (+1 lines)
Lines 8-13 Link Here
8
INSDIR=		lib
8
INSDIR=		lib
9
TARGETLIB=	unls
9
TARGETLIB=	unls
10
#CPPOPTS +=	-Istdio
10
#CPPOPTS +=	-Istdio
11
CPPOPTS +=	-DUSE_ICONV
11
include		Targets
12
include		Targets
12
LIBS=		
13
LIBS=		
13
14
(-)cdrtools-2.01.01.orig/libunls/nls.h (+3 lines)
Lines 110-114 Link Here
110
extern int init_unls_cp10079	__PR((void));
110
extern int init_unls_cp10079	__PR((void));
111
extern int init_unls_cp10081	__PR((void));
111
extern int init_unls_cp10081	__PR((void));
112
extern int init_unls_file	__PR((char * name));
112
extern int init_unls_file	__PR((char * name));
113
#ifdef USE_ICONV
114
extern int init_unls_iconv	__PR((char * name));
115
#endif
113
116
114
#endif	/* _NLS_H */
117
#endif	/* _NLS_H */
(-)cdrtools-2.01.01.orig/libunls/nls_iconv.c (+79 lines)
Line 0 Link Here
1
/* @(#)nls_iconv.c	1.0 02/04/20 2002 J. Schilling  */
2
#ifndef lint
3
static	char sccsid[] =
4
	"@(#)nls_iconv.c	1.0 02/01/20 2002 J. Schilling";
5
#endif
6
/*
7
 * This program is free software; you can redistribute it and/or modify
8
 * it under the terms of the GNU General Public License as published by
9
 * the Free Software Foundation; either version 2, or (at your option)
10
 * any later version.
11
 *
12
 * This program is distributed in the hope that it will be useful,
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 * GNU General Public License for more details.
16
 *
17
 * You should have received a copy of the GNU General Public License
18
 * along with this program; see the file COPYING.  If not, write to
19
 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
20
 */
21
/*
22
 *	Modifications to make the code portable Copyright (c) 2000 J. Schilling
23
 *
24
 * nls_iconv: create a pseudo-charset table to use iconv() provided by C
25
 * library or libiconv by Bruno Haible
26
 * The Unicode to charset table has only exact mappings.
27
 *
28
 *
29
 * Jungshik Shin (jshin@mailaps.org) 04-Feb-2002
30
 */
31
32
#ifdef USE_ICONV
33
#include <mconfig.h>
34
#include <stdio.h>
35
#include <stdxlib.h>
36
#include <strdefs.h>
37
#include "nls.h"
38
#include <iconv.h>
39
40
41
int
42
init_unls_iconv(charset)
43
	char	*charset;
44
{
45
	iconv_t iconv_d;  /* iconv conversion descriptor */
46
	struct unls_table *table;
47
48
	/* give up if no charset is given */
49
	if (charset == NULL)
50
		return -1;
51
52
	/* see if we already have a table with this name - built in tables
53
	   have precedence over iconv() - i.e. can't have the name of an
54
	   existing table. Also, we may have already registered this file
55
	   table */
56
	if (find_unls(charset) != NULL)
57
		return -1;
58
59
	if ((iconv_d = iconv_open("UCS-2BE", charset)) == (iconv_t) -1)
60
		return -1;
61
62
63
	/* set up the table */
64
	if ((table = (struct unls_table *)malloc(sizeof (struct unls_table)))
65
							== NULL) {
66
		return -1;
67
	}
68
69
	/* give the table the file name, so we can find it again if needed */
70
	table->unls_name = strdup(charset);
71
	table->iconv_d = iconv_d;
72
	table->unls_uni2cs = NULL;
73
	table->unls_cs2uni = NULL;
74
	table->unls_next = NULL;
75
76
	/* register the table */
77
	return register_unls(table);
78
}
79
#endif
(-)cdrtools-2.01.01.orig/mkisofs/Makefile (+1 lines)
Lines 31-36 Link Here
31
CPPOPTS +=	-DUDF
31
CPPOPTS +=	-DUDF
32
CPPOPTS +=	-DDVD_VIDEO
32
CPPOPTS +=	-DDVD_VIDEO
33
CPPOPTS +=	-DSORTING
33
CPPOPTS +=	-DSORTING
34
CPPOPTS +=	-DUSE_ICONV
34
CPPOPTS +=	-I../libhfs_iso/
35
CPPOPTS +=	-I../libhfs_iso/
35
CPPOPTS	+=	-DHAVE_CONFIG_H -DUSE_LIBSCHILY -DUSE_SCG \
36
CPPOPTS	+=	-DHAVE_CONFIG_H -DUSE_LIBSCHILY -DUSE_SCG \
36
		'-DAPPID_DEFAULT="MKISOFS ISO 9660/HFS FILESYSTEM BUILDER & CDRECORD CD-R/DVD CREATOR (C) 1993 E.YOUNGDALE (C) 1997 J.PEARSON/J.SCHILLING"' \
37
		'-DAPPID_DEFAULT="MKISOFS ISO 9660/HFS FILESYSTEM BUILDER & CDRECORD CD-R/DVD CREATOR (C) 1993 E.YOUNGDALE (C) 1997 J.PEARSON/J.SCHILLING"' \
(-)cdrtools-2.01.01.orig/mkisofs/joliet.c (-15 / +174 lines)
Lines 90-95 Link Here
90
#include <unls.h>	/* For UNICODE translation */
90
#include <unls.h>	/* For UNICODE translation */
91
#include <schily.h>
91
#include <schily.h>
92
92
93
#ifdef USE_ICONV
94
#include <iconv.h>
95
#include <errno.h>
96
#endif
97
93
static Uint	jpath_table_index;
98
static Uint	jpath_table_index;
94
static struct directory **jpathlist;
99
static struct directory **jpathlist;
95
static int	next_jpath_index = 1;
100
static int	next_jpath_index = 1;
Lines 103-115 Link Here
103
};
108
};
104
109
105
#ifdef	UDF
110
#ifdef	UDF
106
	void	convert_to_unicode	__PR((unsigned char *buffer,
111
#	ifdef USE_ICONV
112
	size_t
113
#	else
114
	void
115
#	endif
116
		convert_to_unicode	__PR((unsigned char *buffer,
107
		int size, char *source, struct unls_table *inls));
117
		int size, char *source, struct unls_table *inls));
108
	int	joliet_strlen		__PR((const char *string));
118
	int	joliet_strlen		__PR((const char *string, struct unls_table *inls));
109
#else
119
#else
110
static void	convert_to_unicode	__PR((unsigned char *buffer,
120
#	ifdef USE_ICONV
121
	static size_t
122
#	else
123
	static void
124
#endif
125
		convert_to_unicode	__PR((unsigned char *buffer,
111
		int size, char *source, struct unls_table *inls));
126
		int size, char *source, struct unls_table *inls));
112
static int	joliet_strlen		__PR((const char *string));
127
static int	joliet_strlen		__PR((const char *string, struct unls_table *inls));
113
#endif
128
#endif
114
static void	get_joliet_vol_desc	__PR((struct iso_primary_descriptor *jvol_desc));
129
static void	get_joliet_vol_desc	__PR((struct iso_primary_descriptor *jvol_desc));
115
static void	assign_joliet_directory_addresses __PR((struct directory *node));
130
static void	assign_joliet_directory_addresses __PR((struct directory *node));
Lines 161-166 Link Here
161
	if (inls == onls)
176
	if (inls == onls)
162
		return (c);
177
		return (c);
163
178
179
#ifdef USE_ICONV
180
	if(inls->unls_cs2uni == NULL || onls->unls_uni2cs == NULL) {
181
		/*
182
		 * This shouldn't be reached
183
		 */
184
		static BOOL iconv_warned = FALSE;
185
		if(!iconv_warned) {
186
			error("Warning: Iconv conversion not supported in conv_charset.\n");
187
			iconv_warned = TRUE;
188
		}
189
		return (c);
190
	}
191
#endif
192
164
	/* get high and low UNICODE bytes */
193
	/* get high and low UNICODE bytes */
165
	uh = inls->unls_cs2uni[c].unls_high;
194
	uh = inls->unls_cs2uni[c].unls_high;
166
	ul = inls->unls_cs2uni[c].unls_low;
195
	ul = inls->unls_cs2uni[c].unls_low;
Lines 186-195 Link Here
186
 *
215
 *
187
 * Notes:
216
 * Notes:
188
 */
217
 */
189
#ifdef	UDF
218
#ifdef USE_ICONV
190
void
219
#	if	UDF
220
size_t
221
#	else
222
static size_t
223
#	endif
191
#else
224
#else
225
#	if	UDF
226
void
227
#	else
192
static void
228
static void
229
#	endif
193
#endif
230
#endif
194
convert_to_unicode(buffer, size, source, inls)
231
convert_to_unicode(buffer, size, source, inls)
195
	unsigned char	*buffer;
232
	unsigned char	*buffer;
Lines 216-221 Link Here
216
		tmpbuf = (Uchar *) source;
253
		tmpbuf = (Uchar *) source;
217
	}
254
	}
218
255
256
#ifdef USE_ICONV
257
	if (inls->iconv_d && inls->unls_cs2uni==NULL &&
258
			inls->unls_uni2cs==NULL) {
259
		char *inptr = tmpbuf;
260
		char *outptr = buffer;
261
		size_t inleft = strlen(tmpbuf);
262
		size_t inlen = inleft;
263
		size_t outleft = size;
264
265
		iconv(inls->iconv_d, NULL, NULL, NULL, NULL);
266
		if(iconv(inls->iconv_d, &inptr, &inleft, &outptr, &outleft) ==
267
				(size_t)-1 && errno == EILSEQ) {
268
			fprintf(stderr, "Incorrectly encoded string (%s) "
269
				"encountered.\nPossibly creating an invalid "
270
				"Joliet extension. Aborting.\n", source);
271
			exit(1);
272
		}
273
274
	  	for (i = 0; (i + 1) < size - outleft; i += 2) {	/* Size may be odd!!!*/
275
			if (buffer[i]=='\0') {
276
				switch (buffer[i+1]) {   /* Invalid characters for Joliet */
277
					case '*':
278
					case '/':
279
					case ':':
280
					case ';':
281
					case '?':
282
					case '\\':
283
						buffer[i+1]='_';
284
					default:
285
						if (buffer[i+1] == 0x7f ||
286
							    buffer[i+1] < 0x20)
287
							buffer[i+1]='_';
288
				}
289
			}
290
		}
291
		if (size & 1) {	/* beautification */
292
	  		buffer[size - 1] = 0;
293
		}
294
		if (source == NULL) {
295
			free(tmpbuf);
296
		}
297
		return (inlen - inleft);
298
	}
299
#endif
300
219
	/*
301
	/*
220
	 * Now start copying characters.  If the size was specified to be 0,
302
	 * Now start copying characters.  If the size was specified to be 0,
221
	 * then assume the input was 0 terminated.
303
	 * then assume the input was 0 terminated.
Lines 271-276 Link Here
271
	if (source == NULL) {
353
	if (source == NULL) {
272
		free(tmpbuf);
354
		free(tmpbuf);
273
	}
355
	}
356
#ifdef USE_ICONV
357
	return j;
358
#endif
274
}
359
}
275
360
276
/*
361
/*
Lines 287-298 Link Here
287
#else
372
#else
288
static int
373
static int
289
#endif
374
#endif
290
joliet_strlen(string)
375
joliet_strlen(string, inls)
291
	const char	*string;
376
	const char	*string;
377
	struct unls_table *inls;
292
{
378
{
293
	int		rtn;
379
	int		rtn;
294
380
381
#ifdef USE_ICONV
382
	if (inls->iconv_d && inls->unls_cs2uni==NULL &&
383
			inls->unls_uni2cs==NULL) {
384
		/*
385
		 * we const-cast since we're sure iconv won't change
386
		 * the string itself
387
		 */
388
		char *string_ptr = (char *)string;
389
		size_t string_len = strlen(string);
390
391
		/*
392
		 * iconv has no way of finding out the required size
393
		 * in the target
394
		 */
395
396
		char *tmp, *tmp_ptr;
397
		/* we assume that the maximum length is 2 * jlen */
398
		size_t tmp_len = (size_t)jlen * 2 + 1;
399
		tmp = e_malloc(tmp_len);
400
		tmp_ptr = tmp;
401
402
		iconv(inls->iconv_d, NULL, NULL, NULL, NULL);
403
		iconv(inls->iconv_d, &string_ptr, &string_len, &tmp_ptr,
404
			&tmp_len);
405
406
		/*
407
		 * iconv advanced the tmp pointer with as many chars
408
		 * as it has written to it, so we add up the delta
409
		 */
410
		rtn = (tmp_ptr - tmp);
411
412
		free(tmp);
413
	} else {
414
		rtn = strlen(string) << 1;
415
	}
416
#else
295
	rtn = strlen(string) << 1;
417
	rtn = strlen(string) << 1;
418
#endif
296
419
297
	/*
420
	/*
298
	 * We do clamp the maximum length of a Joliet string to be the
421
	 * We do clamp the maximum length of a Joliet string to be the
Lines 480-495 Link Here
480
	/* compare the Unicode names */
603
	/* compare the Unicode names */
481
604
482
	while (*rpnt && *lpnt) {
605
	while (*rpnt && *lpnt) {
606
#ifdef USE_ICONV
607
		size_t ri, li;
608
609
		ri = convert_to_unicode(rtmp, 2, rpnt, rinls);
610
		li = convert_to_unicode(ltmp, 2, lpnt, linls);
611
		rpnt += ri;
612
		lpnt += li;
613
		if(!ri && !li)
614
			return (0);
615
		else if(ri && !li)
616
			return (1);
617
		else if(!ri && li)
618
			return (-1);
619
#else
483
		convert_to_unicode(rtmp, 2, rpnt, rinls);
620
		convert_to_unicode(rtmp, 2, rpnt, rinls);
484
		convert_to_unicode(ltmp, 2, lpnt, linls);
621
		convert_to_unicode(ltmp, 2, lpnt, linls);
622
#endif
485
623
486
		if (a_to_u_2_byte(rtmp) < a_to_u_2_byte(ltmp))
624
		if (a_to_u_2_byte(rtmp) < a_to_u_2_byte(ltmp))
487
			return (-1);
625
			return (-1);
488
		if (a_to_u_2_byte(rtmp) > a_to_u_2_byte(ltmp))
626
		if (a_to_u_2_byte(rtmp) > a_to_u_2_byte(ltmp))
489
			return (1);
627
			return (1);
490
628
629
#ifndef USE_ICONV
491
		rpnt++;
630
		rpnt++;
492
		lpnt++;
631
		lpnt++;
632
#endif
493
	}
633
	}
494
634
495
	if (*rpnt)
635
	if (*rpnt)
Lines 574-583 Link Here
574
		}
714
		}
575
#ifdef APPLE_HYB
715
#ifdef APPLE_HYB
576
		if (USE_MAC_NAME(de))
716
		if (USE_MAC_NAME(de))
577
			namelen = joliet_strlen(de->hfs_ent->name);
717
			namelen = joliet_strlen(de->hfs_ent->name, hfs_inls);
578
		else
718
		else
579
#endif	/* APPLE_HYB */
719
#endif	/* APPLE_HYB */
580
			namelen = joliet_strlen(de->name);
720
			namelen = joliet_strlen(de->name, in_nls);
581
721
582
		if (dpnt == root) {
722
		if (dpnt == root) {
583
			jpath_table_l[jpath_table_index] = 1;
723
			jpath_table_l[jpath_table_index] = 1;
Lines 742-751 Link Here
742
#ifdef APPLE_HYB
882
#ifdef APPLE_HYB
743
		/* Use the HFS name if it exists */
883
		/* Use the HFS name if it exists */
744
		if (USE_MAC_NAME(s_entry1))
884
		if (USE_MAC_NAME(s_entry1))
745
			cvt_len = joliet_strlen(s_entry1->hfs_ent->name);
885
			cvt_len = joliet_strlen(s_entry1->hfs_ent->name, hfs_inls);
746
		else
886
		else
747
#endif	/* APPLE_HYB */
887
#endif	/* APPLE_HYB */
748
			cvt_len = joliet_strlen(s_entry1->name);
888
			cvt_len = joliet_strlen(s_entry1->name, in_nls);
749
889
750
		/*
890
		/*
751
		 * Fix the record length
891
		 * Fix the record length
Lines 891-902 Link Here
891
				if (USE_MAC_NAME(s_entry))
1031
				if (USE_MAC_NAME(s_entry))
892
					/* Use the HFS name if it exists */
1032
					/* Use the HFS name if it exists */
893
					jpath_table_size +=
1033
					jpath_table_size +=
894
						joliet_strlen(s_entry->hfs_ent->name) +
1034
						joliet_strlen(s_entry->hfs_ent->name, hfs_inls) +
895
						offsetof(struct iso_path_table, name[0]);
1035
						offsetof(struct iso_path_table, name[0]);
896
				else
1036
				else
897
#endif	/* APPLE_HYB */
1037
#endif	/* APPLE_HYB */
898
					jpath_table_size +=
1038
					jpath_table_size +=
899
						joliet_strlen(s_entry->name) +
1039
						joliet_strlen(s_entry->name, in_nls) +
900
						offsetof(struct iso_path_table, name[0]);
1040
						offsetof(struct iso_path_table, name[0]);
901
				if (jpath_table_size & 1) {
1041
				if (jpath_table_size & 1) {
902
					jpath_table_size++;
1042
					jpath_table_size++;
Lines 918-930 Link Here
918
				/* Use the HFS name if it exists */
1058
				/* Use the HFS name if it exists */
919
				s_entry->jreclen =
1059
				s_entry->jreclen =
920
				offsetof(struct iso_directory_record, name[0])
1060
				offsetof(struct iso_directory_record, name[0])
921
					+ joliet_strlen(s_entry->hfs_ent->name)
1061
					+ joliet_strlen(s_entry->hfs_ent->name, hfs_inls)
922
					+ 1;
1062
					+ 1;
923
			else
1063
			else
924
#endif	/* APPLE_HYB */
1064
#endif	/* APPLE_HYB */
925
				s_entry->jreclen =
1065
				s_entry->jreclen =
926
				offsetof(struct iso_directory_record, name[0])
1066
				offsetof(struct iso_directory_record, name[0])
927
					+ joliet_strlen(s_entry->name)
1067
					+ joliet_strlen(s_entry->name, in_nls)
928
					+ 1;
1068
					+ 1;
929
		} else {
1069
		} else {
930
			/*
1070
			/*
Lines 1072-1077 Link Here
1072
#endif
1212
#endif
1073
1213
1074
	while (*rpnt && *lpnt) {
1214
	while (*rpnt && *lpnt) {
1215
#ifdef USE_ICONV
1216
		size_t ri, li;
1217
#endif
1075
		if (*rpnt == ';' && *lpnt != ';')
1218
		if (*rpnt == ';' && *lpnt != ';')
1076
			return (-1);
1219
			return (-1);
1077
		if (*rpnt != ';' && *lpnt == ';')
1220
		if (*rpnt != ';' && *lpnt == ';')
Lines 1092-1107 Link Here
1092
			return (1);
1235
			return (1);
1093
#endif
1236
#endif
1094
1237
1238
#ifdef USE_ICONV
1239
1240
		ri = convert_to_unicode(rtmp, 2, rpnt, rinls);
1241
		li = convert_to_unicode(ltmp, 2, lpnt, linls);
1242
		rpnt += ri;
1243
		lpnt += li;
1244
		if(!ri && !li)
1245
			return (0);
1246
		else if(ri && !li)
1247
			return (1);
1248
		else if(!ri && li)
1249
			return (-1);
1250
#else
1095
		convert_to_unicode(rtmp, 2, rpnt, rinls);
1251
		convert_to_unicode(rtmp, 2, rpnt, rinls);
1096
		convert_to_unicode(ltmp, 2, lpnt, linls);
1252
		convert_to_unicode(ltmp, 2, lpnt, linls);
1253
#endif
1097
1254
1098
		if (a_to_u_2_byte(rtmp) < a_to_u_2_byte(ltmp))
1255
		if (a_to_u_2_byte(rtmp) < a_to_u_2_byte(ltmp))
1099
			return (-1);
1256
			return (-1);
1100
		if (a_to_u_2_byte(rtmp) > a_to_u_2_byte(ltmp))
1257
		if (a_to_u_2_byte(rtmp) > a_to_u_2_byte(ltmp))
1101
			return (1);
1258
			return (1);
1102
1259
1260
#ifndef USE_ICONV
1103
		rpnt++;
1261
		rpnt++;
1104
		lpnt++;
1262
		lpnt++;
1263
#endif
1105
	}
1264
	}
1106
	if (*rpnt)
1265
	if (*rpnt)
1107
		return (1);
1266
		return (1);
(-)cdrtools-2.01.01.orig/mkisofs/mkisofs.c (+46 lines)
Lines 59-64 Link Here
59
#endif
59
#endif
60
#endif	/* no_more_needed */
60
#endif	/* no_more_needed */
61
61
62
#ifdef USE_ICONV
63
#include <locale.h>
64
#include <langinfo.h>
65
#endif
66
62
struct directory *root = NULL;
67
struct directory *root = NULL;
63
int		path_ind;
68
int		path_ind;
64
69
Lines 223-228 Link Here
223
int	do_sort = 0;		/* sort file data */
228
int	do_sort = 0;		/* sort file data */
224
#endif /* SORTING */
229
#endif /* SORTING */
225
230
231
#ifdef USE_ICONV
232
int iconv_possible;
233
#endif
234
226
struct unls_table *in_nls = NULL;  /* input UNICODE conversion table */
235
struct unls_table *in_nls = NULL;  /* input UNICODE conversion table */
227
struct unls_table *out_nls = NULL; /* output UNICODE conversion table */
236
struct unls_table *out_nls = NULL; /* output UNICODE conversion table */
228
#ifdef APPLE_HYB
237
#ifdef APPLE_HYB
Lines 2339-2344 Link Here
2339
	init_unls_file(hfs_ocharset);
2348
	init_unls_file(hfs_ocharset);
2340
#endif /* APPLE_HYB */
2349
#endif /* APPLE_HYB */
2341
2350
2351
#ifdef USE_ICONV
2352
	iconv_possible = !(iso9660_level >= 4 || ((ocharset &&
2353
		strcmp(ocharset, icharset ? icharset : "")) &&
2354
		use_RockRidge) || apple_ext || apple_hyb);
2355
2356
	setlocale(LC_CTYPE, "");
2357
	
2358
  	if (icharset == NULL && iconv_possible) {
2359
		char *charset = nl_langinfo(CODESET);
2360
		/* set to detected value but only if it is not pure US-ASCII */
2361
		if(strcmp(charset, "ANSI_X3.4-1968") != 0)
2362
			icharset = charset;
2363
2364
		if(icharset && verbose > 0)
2365
			fprintf(stderr, "INFO:\t"
2366
			"%s character encoding detected by locale settings."
2367
			"\n\tAssuming %s encoded filenames on source "
2368
			"filesystem,\n"
2369
			"\tuse -input-charset to override.\n",
2370
			icharset, icharset);
2371
	}
2372
2373
	if(iconv_possible) {
2374
		/*
2375
		 * don't care if initialization fails
2376
		 */
2377
		init_unls_iconv(icharset);
2378
		init_unls_iconv(ocharset);
2379
	}
2380
#endif
2381
2342
	if (icharset == NULL) {
2382
	if (icharset == NULL) {
2343
#if	(defined(__CYGWIN32__) || defined(__CYGWIN__) || defined(__DJGPP__)) && !defined(IS_CYGWIN_1)
2383
#if	(defined(__CYGWIN32__) || defined(__CYGWIN__) || defined(__DJGPP__)) && !defined(IS_CYGWIN_1)
2344
		in_nls = load_unls("cp437");
2384
		in_nls = load_unls("cp437");
Lines 2366-2371 Link Here
2366
	if (in_nls == NULL || out_nls == NULL) { /* Unknown charset specified */
2406
	if (in_nls == NULL || out_nls == NULL) { /* Unknown charset specified */
2367
		fprintf(stderr, "Unknown charset\nKnown charsets are:\n");
2407
		fprintf(stderr, "Unknown charset\nKnown charsets are:\n");
2368
		list_unls();	/* List all known charset names */
2408
		list_unls();	/* List all known charset names */
2409
#ifdef USE_ICONV
2410
		if(!iconv_possible)
2411
			fprintf(stderr, "Iconv charsets cannot be used with "
2412
				"Apple extension, HFS, ISO9660 version 2 or\n"
2413
				"Rock Ridge.\n");
2414
#endif
2369
		exit(1);
2415
		exit(1);
2370
	}
2416
	}
2371
2417
(-)cdrtools-2.01.01.orig/mkisofs/mkisofs.h (-1 / +6 lines)
Lines 503-511 Link Here
503
503
504
/* joliet.c */
504
/* joliet.c */
505
#ifdef	UDF
505
#ifdef	UDF
506
#	ifdef USE_ICONV
507
extern	size_t	convert_to_unicode	__PR((unsigned char *buffer,
508
			int size, char *source, struct unls_table *inls));
509
#	else
506
extern	void	convert_to_unicode	__PR((unsigned char *buffer,
510
extern	void	convert_to_unicode	__PR((unsigned char *buffer,
507
			int size, char *source, struct unls_table *inls));
511
			int size, char *source, struct unls_table *inls));
508
extern	int	joliet_strlen		__PR((const char *string));
512
#	endif
513
extern	int joliet_strlen		__PR((const char *string, struct unls_table *inls));
509
#endif
514
#endif
510
extern unsigned char conv_charset __PR((unsigned char, struct unls_table *,
515
extern unsigned char conv_charset __PR((unsigned char, struct unls_table *,
511
				struct unls_table *));
516
				struct unls_table *));
(-)cdrtools-2.01.01.orig/mkisofs/udf.c (-1 / +1 lines)
Lines 441-447 Link Here
441
	int i;
441
	int i;
442
	int expanded_length;
442
	int expanded_length;
443
443
444
	expanded_length = joliet_strlen(src);
444
	expanded_length = joliet_strlen(src, in_nls);
445
	if (expanded_length > 1024)
445
	if (expanded_length > 1024)
446
		expanded_length = 1024;
446
		expanded_length = 1024;
447
	if (expanded_length > (dst_size-1)*2)
447
	if (expanded_length > (dst_size-1)*2)

Return to bug 129759