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

(-)cdrtools-2.01.01/include/schily/unls.h (+12 lines)
Lines 23-28 Link Here
23
#include <schily/mconfig.h>
23
#include <schily/mconfig.h>
24
#endif
24
#endif
25
25
26
#ifdef USE_ICONV
27
#include <iconv.h>
28
#endif
29
26
#ifdef	__cplusplus
30
#ifdef	__cplusplus
27
extern "C" {
31
extern "C" {
28
#endif
32
#endif
Lines 37-42 Link Here
37
	unsigned char 	**unls_uni2cs;		/* Unicode -> Charset	*/
41
	unsigned char 	**unls_uni2cs;		/* Unicode -> Charset	*/
38
	struct unls_unicode *unls_cs2uni;	/* Charset -> Unicode	*/
42
	struct unls_unicode *unls_cs2uni;	/* Charset -> Unicode	*/
39
	struct unls_table *unls_next;		/* Next table		*/
43
	struct unls_table *unls_next;		/* Next table		*/
44
45
#ifdef USE_ICONV
46
	iconv_t iconv_d;
47
#endif
40
};
48
};
41
49
42
extern int		init_unls		__PR((void));
50
extern int		init_unls		__PR((void));
Lines 49-54 Link Here
49
extern struct unls_table *load_unls_default	__PR((void));
57
extern struct unls_table *load_unls_default	__PR((void));
50
extern int		init_unls_file		__PR((char * name));
58
extern int		init_unls_file		__PR((char * name));
51
59
60
#ifdef USE_ICONV
61
extern int            init_nls_iconv     	__PR((char * name));
62
#endif
63
52
#ifdef	__cplusplus
64
#ifdef	__cplusplus
53
}
65
}
54
#endif
66
#endif
(-)cdrtools-2.01.01/libunls/libunls.mk (-1 / +1 lines)
Lines 8-14 Link Here
8
INSDIR=		lib
8
INSDIR=		lib
9
TARGETLIB=	unls
9
TARGETLIB=	unls
10
#CPPOPTS +=	-Istdio
10
#CPPOPTS +=	-Istdio
11
CPPOPTS +=	-DSCHILY_PRINT
11
CPPOPTS +=	-DSCHILY_PRINT -DUSE_ICONV
12
12
13
include		Targets
13
include		Targets
14
LIBS=		
14
LIBS=		
(-)cdrtools-2.01.01/libunls/nls.h (+4 lines)
Lines 111-114 Link Here
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
113
114
#ifdef USE_ICONV
115
extern int init_nls_iconv     	__PR((char * name));
116
#endif
117
114
#endif	/* _NLS_H */
118
#endif	/* _NLS_H */
(-)cdrtools-2.01.01/libunls/nls_iconv.c (+97 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
static void	inc_use_count	__PR((void));
41
static void	dec_use_count	__PR((void));
42
43
44
static void
45
inc_use_count()
46
{
47
	MOD_INC_USE_COUNT;
48
}
49
50
static void
51
dec_use_count()
52
{
53
	MOD_DEC_USE_COUNT;
54
}
55
56
int
57
init_nls_iconv(charset)
58
	char	*charset;
59
{
60
	iconv_t iconv_d;  /* iconv conversion descriptor */
61
	struct unls_table *table;
62
63
	/* give up if no charset is given */
64
	if (charset == NULL)
65
		return -1;
66
67
	/* see if we already have a table with this name - built in tables
68
	   have precedence over iconv() - i.e. can't have the name of an
69
	   existing table. Also, we may have already registered this file
70
	   table */
71
	if (find_unls(charset) != NULL)
72
		return -1;
73
74
	if ((iconv_d = iconv_open("UCS-2BE", charset)) == (iconv_t) -1)
75
		return -1;
76
77
78
	/* set up the table */
79
	if ((table = (struct unls_table *)malloc(sizeof (struct unls_table)))
80
							== NULL) {
81
		return -1;
82
	}
83
84
	/* give the table the file name, so we can find it again if needed */
85
	table->unls_name = strdup(charset);
86
	table->iconv_d = iconv_d;
87
	table->unls_cs2uni = NULL;
88
	table->unls_uni2cs = NULL;
89
//	table->inc_use_count = inc_use_count;
90
//	table->dec_use_count = dec_use_count;
91
	table->unls_next = NULL;
92
93
	/* register the table */
94
	return register_unls(table);
95
}
96
#endif
97
(-)cdrtools-2.01.01/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/mkisofs/joliet.c (-15 / +174 lines)
Lines 90-95 Link Here
90
#include <schily/unls.h>	/* For UNICODE translation */
90
#include <schily/unls.h>	/* For UNICODE translation */
91
#include <schily/schily.h>
91
#include <schily/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 481-496 Link Here
481
	/* compare the Unicode names */
604
	/* compare the Unicode names */
482
605
483
	while (*rpnt && *lpnt) {
606
	while (*rpnt && *lpnt) {
607
#ifdef USE_ICONV
608
		size_t ri, li;
609
610
		ri = convert_to_unicode(rtmp, 2, rpnt, rinls);
611
		li = convert_to_unicode(ltmp, 2, lpnt, linls);
612
		rpnt += ri;
613
		lpnt += li;
614
		if(!ri && !li)
615
			return (0);
616
		else if(ri && !li)
617
			return (1);
618
		else if(!ri && li)
619
			return (-1);
620
#else
484
		convert_to_unicode(rtmp, 2, rpnt, rinls);
621
		convert_to_unicode(rtmp, 2, rpnt, rinls);
485
		convert_to_unicode(ltmp, 2, lpnt, linls);
622
		convert_to_unicode(ltmp, 2, lpnt, linls);
623
#endif
486
624
487
		if (a_to_u_2_byte(rtmp) < a_to_u_2_byte(ltmp))
625
		if (a_to_u_2_byte(rtmp) < a_to_u_2_byte(ltmp))
488
			return (-1);
626
			return (-1);
489
		if (a_to_u_2_byte(rtmp) > a_to_u_2_byte(ltmp))
627
		if (a_to_u_2_byte(rtmp) > a_to_u_2_byte(ltmp))
490
			return (1);
628
			return (1);
491
629
630
#ifndef USE_ICONV
492
		rpnt++;
631
		rpnt++;
493
		lpnt++;
632
		lpnt++;
633
#endif
494
	}
634
	}
495
635
496
	if (*rpnt)
636
	if (*rpnt)
Lines 564-573 Link Here
564
		}
704
		}
565
#ifdef APPLE_HYB
705
#ifdef APPLE_HYB
566
		if (USE_MAC_NAME(de))
706
		if (USE_MAC_NAME(de))
567
			namelen = joliet_strlen(de->hfs_ent->name);
707
			namelen = joliet_strlen(de->hfs_ent->name, hfs_inls);
568
		else
708
		else
569
#endif	/* APPLE_HYB */
709
#endif	/* APPLE_HYB */
570
			namelen = joliet_strlen(de->name);
710
			namelen = joliet_strlen(de->name, in_nls);
571
711
572
		if (dpnt == root) {
712
		if (dpnt == root) {
573
			jpath_table_l[jpath_table_index] = 1;
713
			jpath_table_l[jpath_table_index] = 1;
Lines 712-721 Link Here
712
#ifdef APPLE_HYB
852
#ifdef APPLE_HYB
713
		/* Use the HFS name if it exists */
853
		/* Use the HFS name if it exists */
714
		if (USE_MAC_NAME(s_entry1))
854
		if (USE_MAC_NAME(s_entry1))
715
			cvt_len = joliet_strlen(s_entry1->hfs_ent->name);
855
			cvt_len = joliet_strlen(s_entry1->hfs_ent->name, hfs_inls);
716
		else
856
		else
717
#endif	/* APPLE_HYB */
857
#endif	/* APPLE_HYB */
718
			cvt_len = joliet_strlen(s_entry1->name);
858
			cvt_len = joliet_strlen(s_entry1->name, in_nls);
719
859
720
		/*
860
		/*
721
		 * Fix the record length
861
		 * Fix the record length
Lines 849-860 Link Here
849
				if (USE_MAC_NAME(s_entry))
989
				if (USE_MAC_NAME(s_entry))
850
					/* Use the HFS name if it exists */
990
					/* Use the HFS name if it exists */
851
					jpath_table_size +=
991
					jpath_table_size +=
852
						joliet_strlen(s_entry->hfs_ent->name) +
992
						joliet_strlen(s_entry->hfs_ent->name, hfs_inls) +
853
						offsetof(struct iso_path_table, name[0]);
993
						offsetof(struct iso_path_table, name[0]);
854
				else
994
				else
855
#endif	/* APPLE_HYB */
995
#endif	/* APPLE_HYB */
856
					jpath_table_size +=
996
					jpath_table_size +=
857
						joliet_strlen(s_entry->name) +
997
						joliet_strlen(s_entry->name, in_nls) +
858
						offsetof(struct iso_path_table, name[0]);
998
						offsetof(struct iso_path_table, name[0]);
859
				if (jpath_table_size & 1) {
999
				if (jpath_table_size & 1) {
860
					jpath_table_size++;
1000
					jpath_table_size++;
Lines 876-888 Link Here
876
				/* Use the HFS name if it exists */
1016
				/* Use the HFS name if it exists */
877
				s_entry->jreclen =
1017
				s_entry->jreclen =
878
				offsetof(struct iso_directory_record, name[0])
1018
				offsetof(struct iso_directory_record, name[0])
879
					+ joliet_strlen(s_entry->hfs_ent->name)
1019
					+ joliet_strlen(s_entry->hfs_ent->name, hfs_inls)
880
					+ 1;
1020
					+ 1;
881
			else
1021
			else
882
#endif	/* APPLE_HYB */
1022
#endif	/* APPLE_HYB */
883
				s_entry->jreclen =
1023
				s_entry->jreclen =
884
				offsetof(struct iso_directory_record, name[0])
1024
				offsetof(struct iso_directory_record, name[0])
885
					+ joliet_strlen(s_entry->name)
1025
					+ joliet_strlen(s_entry->name, in_nls)
886
					+ 1;
1026
					+ 1;
887
		} else {
1027
		} else {
888
			/*
1028
			/*
Lines 1024-1029 Link Here
1024
#endif
1164
#endif
1025
1165
1026
	while (*rpnt && *lpnt) {
1166
	while (*rpnt && *lpnt) {
1167
#ifdef USE_ICONV
1168
		size_t ri, li;
1169
#endif
1027
		if (*rpnt == ';' && *lpnt != ';')
1170
		if (*rpnt == ';' && *lpnt != ';')
1028
			return (-1);
1171
			return (-1);
1029
		if (*rpnt != ';' && *lpnt == ';')
1172
		if (*rpnt != ';' && *lpnt == ';')
Lines 1044-1059 Link Here
1044
			return (1);
1187
			return (1);
1045
#endif
1188
#endif
1046
1189
1190
#ifdef USE_ICONV
1191
1192
		ri = convert_to_unicode(rtmp, 2, rpnt, rinls);
1193
		li = convert_to_unicode(ltmp, 2, lpnt, linls);
1194
		rpnt += ri;
1195
		lpnt += li;
1196
		if(!ri && !li)
1197
			return (0);
1198
		else if(ri && !li)
1199
			return (1);
1200
		else if(!ri && li)
1201
			return (-1);
1202
#else
1047
		convert_to_unicode(rtmp, 2, rpnt, rinls);
1203
		convert_to_unicode(rtmp, 2, rpnt, rinls);
1048
		convert_to_unicode(ltmp, 2, lpnt, linls);
1204
		convert_to_unicode(ltmp, 2, lpnt, linls);
1205
#endif
1049
1206
1050
		if (a_to_u_2_byte(rtmp) < a_to_u_2_byte(ltmp))
1207
		if (a_to_u_2_byte(rtmp) < a_to_u_2_byte(ltmp))
1051
			return (-1);
1208
			return (-1);
1052
		if (a_to_u_2_byte(rtmp) > a_to_u_2_byte(ltmp))
1209
		if (a_to_u_2_byte(rtmp) > a_to_u_2_byte(ltmp))
1053
			return (1);
1210
			return (1);
1054
1211
1212
#ifndef USE_ICONV
1055
		rpnt++;
1213
		rpnt++;
1056
		lpnt++;
1214
		lpnt++;
1215
#endif
1057
	}
1216
	}
1058
	if (*rpnt)
1217
	if (*rpnt)
1059
		return (1);
1218
		return (1);
(-)cdrtools-2.01.01/mkisofs/Makefile (+1 lines)
Lines 33-38 Link Here
33
CPPOPTS +=	-DUDF
33
CPPOPTS +=	-DUDF
34
CPPOPTS +=	-DDVD_VIDEO
34
CPPOPTS +=	-DDVD_VIDEO
35
CPPOPTS +=	-DSORTING
35
CPPOPTS +=	-DSORTING
36
CPPOPTS +=	-DUSE_ICONV
36
CPPOPTS +=	-I../libhfs_iso/
37
CPPOPTS +=	-I../libhfs_iso/
37
CPPOPTS	+=	-DUSE_SCG \
38
CPPOPTS	+=	-DUSE_SCG \
38
		'-DAPPID_DEFAULT="MKISOFS ISO 9660/HFS FILESYSTEM BUILDER & CDRECORD CD-R/DVD CREATOR (C) 1993 E.YOUNGDALE (C) 1997 J.PEARSON/J.SCHILLING"' \
39
		'-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/mkisofs/mkisofs.c (+46 lines)
Lines 63-68 Link Here
63
#endif
63
#endif
64
#endif	/* no_more_needed */
64
#endif	/* no_more_needed */
65
65
66
#ifdef USE_ICONV
67
#include <locale.h>
68
#include <langinfo.h>
69
#endif
70
66
struct directory *root = NULL;
71
struct directory *root = NULL;
67
int		path_ind;
72
int		path_ind;
68
73
Lines 290-295 Link Here
290
int	do_sort = 0;		/* sort file data */
295
int	do_sort = 0;		/* sort file data */
291
#endif /* SORTING */
296
#endif /* SORTING */
292
297
298
#ifdef USE_ICONV
299
int   iconv_possible;
300
#endif
301
293
/*
302
/*
294
 * inode numbers for zero sized files start from this number and count
303
 * inode numbers for zero sized files start from this number and count
295
 * backwards. This is done to allow unique inode numbers even on multi-session
304
 * backwards. This is done to allow unique inode numbers even on multi-session
Lines 2060-2065 Link Here
2060
	init_unls_file(hfs_ocharset);
2069
	init_unls_file(hfs_ocharset);
2061
#endif /* APPLE_HYB */
2070
#endif /* APPLE_HYB */
2062
2071
2072
#ifdef USE_ICONV
2073
	iconv_possible = !(iso9660_level >= 4 || ((ocharset &&
2074
		strcmp(ocharset, icharset ? icharset : "")) &&
2075
		use_RockRidge) || apple_ext || apple_hyb);
2076
2077
	setlocale(LC_CTYPE, "");
2078
	
2079
  	if (icharset == NULL && iconv_possible) {
2080
		char *charset = nl_langinfo(CODESET);
2081
		/* set to detected value but only if it is not pure US-ASCII */
2082
		if(strcmp(charset, "ANSI_X3.4-1968") != 0)
2083
			icharset = charset;
2084
2085
		if(icharset && verbose > 0)
2086
			fprintf(stderr, "INFO:\t"
2087
			"%s character encoding detected by locale settings."
2088
			"\n\tAssuming %s encoded filenames on source "
2089
			"filesystem,\n"
2090
			"\tuse -input-charset to override.\n",
2091
			icharset, icharset);
2092
	}
2093
2094
	if(iconv_possible) {
2095
		/*
2096
		 * don't care if initialization fails
2097
		 */
2098
		init_nls_iconv(icharset);
2099
		init_nls_iconv(ocharset);
2100
	}
2101
#endif
2102
2063
	if (icharset == NULL) {
2103
	if (icharset == NULL) {
2064
#if	(defined(__CYGWIN32__) || defined(__CYGWIN__) || defined(__DJGPP__)) && !defined(IS_CYGWIN_1)
2104
#if	(defined(__CYGWIN32__) || defined(__CYGWIN__) || defined(__DJGPP__)) && !defined(IS_CYGWIN_1)
2065
		in_nls = load_unls("cp437");
2105
		in_nls = load_unls("cp437");
Lines 2087-2093 Link Here
2087
	if (in_nls == NULL || out_nls == NULL) { /* Unknown charset specified */
2127
	if (in_nls == NULL || out_nls == NULL) { /* Unknown charset specified */
2088
		fprintf(stderr, "Unknown charset\nKnown charsets are:\n");
2128
		fprintf(stderr, "Unknown charset\nKnown charsets are:\n");
2089
		list_unls();	/* List all known charset names */
2129
		list_unls();	/* List all known charset names */
2130
#ifdef USE_ICONV
2131
		if(!iconv_possible)
2132
			fprintf(stderr, "Iconv charsets cannot be used with "
2133
                               	"Apple extension, HFS, ISO9660 version 2 or\n"
2134
                               	"Rock Ridge.\n");
2090
		exit(1);
2135
		exit(1);
2136
#endif
2091
	}
2137
	}
2092
2138
2093
2139
(-)cdrtools-2.01.01/mkisofs/mkisofs.h (-1 / +6 lines)
Lines 514-522 Link Here
514
514
515
/* joliet.c */
515
/* joliet.c */
516
#ifdef	UDF
516
#ifdef	UDF
517
#     ifdef USE_ICONV
518
extern        size_t  convert_to_unicode      __PR((unsigned char *buffer,
519
                       int size, char *source, struct unls_table *inls));
520
#     else
517
extern	void	convert_to_unicode	__PR((unsigned char *buffer,
521
extern	void	convert_to_unicode	__PR((unsigned char *buffer,
518
			int size, char *source, struct unls_table *inls));
522
			int size, char *source, struct unls_table *inls));
519
extern	int	joliet_strlen		__PR((const char *string));
523
#endif
524
extern        int     joliet_strlen           __PR((const char *string, struct unls_table *inls));
520
#endif
525
#endif
521
extern unsigned char conv_charset __PR((unsigned char, struct unls_table *,
526
extern unsigned char conv_charset __PR((unsigned char, struct unls_table *,
522
				struct unls_table *));
527
				struct unls_table *));
(-)cdrtools-2.01.01/mkisofs/udf.c (-1 / +1 lines)
Lines 436-442 Link Here
436
	int i;
436
	int i;
437
	int expanded_length;
437
	int expanded_length;
438
438
439
	expanded_length = joliet_strlen(src);
439
	expanded_length = joliet_strlen(src, in_nls);
440
	if (expanded_length > 1024)
440
	if (expanded_length > 1024)
441
		expanded_length = 1024;
441
		expanded_length = 1024;
442
	if (expanded_length > (dst_size-1)*2)
442
	if (expanded_length > (dst_size-1)*2)

Return to bug 178856