From 581ea8f33bacae1248d65ea23798de528e0d8b56 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Fri, 7 Nov 2008 17:33:59 +0000 Subject: [PATCH] Copying -out_charset to -in_charset after -commit --- libisoburn/trunk/xorriso/xorriso.1 | 20 ++++++++++++++++++++ libisoburn/trunk/xorriso/xorriso.c | 2 ++ libisoburn/trunk/xorriso/xorriso_private.h | 3 +++ libisoburn/trunk/xorriso/xorriso_timestamp.h | 2 +- libisoburn/trunk/xorriso/xorrisoburn.c | 2 +- 5 files changed, 27 insertions(+), 2 deletions(-) diff --git a/libisoburn/trunk/xorriso/xorriso.1 b/libisoburn/trunk/xorriso/xorriso.1 index 546990c8..098e4d1e 100644 --- a/libisoburn/trunk/xorriso/xorriso.1 +++ b/libisoburn/trunk/xorriso/xorriso.1 @@ -559,6 +559,8 @@ will be reset to "auto". Set the character set from which to convert file names when loading an image. This has eventually to be done before specifying -dev , -indev or -rollback. See paragraph "Character sets" for more explanations. +When loading the written image after -commit the setting of -out_charset +will be copied to -in_charset. .TP \fB\-rom_toc_scan\fR "on"|"off"[:"emul_on"|"emul_off"] Read-only drives do not tell the actual media type but show any media as @@ -1360,6 +1362,8 @@ are up to 128 characters. \fB\-out_charset\fR character_set_name Set the character set to which file names get converted when writing an image. See paragraph "Character sets" for more explanations. +When loading the written image after -commit the setting of -out_charset +will be copied to -in_charset. .TP \fB\-uid\fR uid User id to be used for all files when the new ISO tree gets written to media. @@ -2419,6 +2423,8 @@ Copy modified ISO image from one media to another .br Bring a prepared ISOLINUX tree onto media and make it bootable .br +Change existing file name tree from ISO-8859-1 to UTF-8 +.br Operate on storage facilities other than optical drives .br Perform multi-session runs as of cdrtools traditions @@ -2584,6 +2590,20 @@ Now xorriso can burn an El Torito bootable media: .br -boot_image isolinux dir=/boot/isolinux .SS +.B Change existing file name tree from ISO-8859-1 to UTF-8 +This example assumes that the existing ISO image was written with character +set ISO-8859-1 but that the readers expected UTF-8. Now a new session with +the same files gets added with converted file names. +In order to avoid any weaknesses of the local character set this command +pretends that it is already the final target set UTF-8. +Therefore strange file names may appear in eventual error messages. +.br +\fB$\fR xorriso -in_charset ISO-8859-1 -local_charset UTF-8 \\ +.br + -out_charset UTF-8 -dev /dev/sr0 \\ +.br + -alter_date m +0 / -- -commit -eject all +.SS .B Operate on storage facilities other than optical drives Full read-write operation is possible with regular files and block devices: .br diff --git a/libisoburn/trunk/xorriso/xorriso.c b/libisoburn/trunk/xorriso/xorriso.c index b1b3ecaa..3291ef55 100644 --- a/libisoburn/trunk/xorriso/xorriso.c +++ b/libisoburn/trunk/xorriso/xorriso.c @@ -11258,6 +11258,8 @@ int Xorriso_option_commit(struct XorrisO *xorriso, int flag) xorriso->no_volset_present= 0; if(flag&1) return(1); + if(Sregex_string(&(xorriso->in_charset), xorriso->out_charset, 0) <= 0) + return(-1); strcpy(newdev, xorriso->outdev); if(xorriso->grow_blindly_msc2>=0) ret= Xorriso_option_dev(xorriso, "", 3|4); diff --git a/libisoburn/trunk/xorriso/xorriso_private.h b/libisoburn/trunk/xorriso/xorriso_private.h index 2a02ae2c..deb1449c 100644 --- a/libisoburn/trunk/xorriso/xorriso_private.h +++ b/libisoburn/trunk/xorriso/xorriso_private.h @@ -802,5 +802,8 @@ int Sectorbitmap_get_layout(struct SectorbitmaP *o, int Sectorbitmap_copy(struct SectorbitmaP *from, struct SectorbitmaP *to, int flag); +/* bit0= append (text!=NULL) */ +int Sregex_string(char **handle, char *text, int flag); + #endif /* Xorriso_private_includeD */ diff --git a/libisoburn/trunk/xorriso/xorriso_timestamp.h b/libisoburn/trunk/xorriso/xorriso_timestamp.h index 61dc6efd..536b5829 100644 --- a/libisoburn/trunk/xorriso/xorriso_timestamp.h +++ b/libisoburn/trunk/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2008.11.06.183736" +#define Xorriso_timestamP "2008.11.07.173315" diff --git a/libisoburn/trunk/xorriso/xorrisoburn.c b/libisoburn/trunk/xorriso/xorrisoburn.c index 08255af7..941b2a08 100644 --- a/libisoburn/trunk/xorriso/xorrisoburn.c +++ b/libisoburn/trunk/xorriso/xorrisoburn.c @@ -8167,7 +8167,7 @@ cannot:; } sprintf(xorriso->info_text, "Local character set is now assumed as: %s", Text_shellsafe(name, sfe, 0)); - Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "NOTE", 0); + Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); return(1); }