brasero r1577 - in trunk: . src src/plugins/cdrkit src/plugins/cdrtools
- From: philippr svn gnome org
- To: svn-commits-list gnome org
- Subject: brasero r1577 - in trunk: . src src/plugins/cdrkit src/plugins/cdrtools
- Date: Fri, 28 Nov 2008 19:15:34 +0000 (UTC)
Author: philippr
Date: Fri Nov 28 19:15:34 2008
New Revision: 1577
URL: http://svn.gnome.org/viewvc/brasero?rev=1577&view=rev
Log:
Convert all CD-TEXT to iso-8859-1 before letting cdrecord/wodim write it
* src/burn-medium.c (brasero_medium_get_CD_TEXT):
* src/plugins/cdrkit/burn-wodim.c (brasero_wodim_write_inf):
* src/plugins/cdrtools/burn-cdrecord.c
(brasero_cdrecord_write_inf):
Modified:
trunk/ChangeLog
trunk/src/burn-medium.c
trunk/src/plugins/cdrkit/burn-wodim.c
trunk/src/plugins/cdrtools/burn-cdrecord.c
Modified: trunk/src/burn-medium.c
==============================================================================
--- trunk/src/burn-medium.c (original)
+++ trunk/src/burn-medium.c Fri Nov 28 19:15:34 2008
@@ -2822,14 +2822,14 @@
g_get_charset (&charset);
- /* it's ASCII so convert to locale */
+ /* It's ASCII so convert to locale */
switch (charset_CD_TEXT) {
case BRASERO_CD_TEXT_8859_1:
utf8_string = g_convert_with_fallback (string,
-1,
charset,
"ISO-8859-1",
- NULL,
+ "_",
NULL,
NULL,
NULL);
@@ -2839,7 +2839,7 @@
-1,
charset,
"EUC-JP",
- NULL,
+ "_",
NULL,
NULL,
NULL);
@@ -2849,7 +2849,7 @@
-1,
charset,
"EUC-KR",
- NULL,
+ "_",
NULL,
NULL,
NULL);
@@ -2859,7 +2859,7 @@
-1,
charset,
"GB2312",
- NULL,
+ "_",
NULL,
NULL,
NULL);
@@ -2870,7 +2870,7 @@
-1,
charset,
"ASCII",
- NULL,
+ "_",
NULL,
NULL,
NULL);
@@ -2880,8 +2880,10 @@
if (priv->CD_TEXT_title)
g_free (priv->CD_TEXT_title);
- if (!utf8_string)
+ if (!utf8_string) {
+ BRASERO_BURN_LOG ("Charset convertion failed");
priv->CD_TEXT_title = g_strdup (string);
+ }
else
priv->CD_TEXT_title = utf8_string;
Modified: trunk/src/plugins/cdrkit/burn-wodim.c
==============================================================================
--- trunk/src/plugins/cdrkit/burn-wodim.c (original)
+++ trunk/src/plugins/cdrkit/burn-wodim.c Fri Nov 28 19:15:34 2008
@@ -411,6 +411,16 @@
BRASERO_JOB_LOG (wodim, "writing inf (%s)", path);
+ /* The problem here is that when writing CD-TEXT from .inf files, wodim
+ * uses only one charset (and don't let us specify which one) which is
+ * ISO-8859-1. (NOTE: don't believe the doc claiming it requires ASCII
+ * and see cdrecord/cdtext.c line 309).
+ * So we have to convert our UTF-8 input into such a charset.
+ * NOTE: according to docs ASCII should be used for text packs other
+ * than disc/track title.
+ * It might be good in the end to write and pack CD-TEXT pack data
+ * ourselves so we can set a different charset from English like
+ * Chinese for example. */
info = brasero_track_get_audio_info (track);
strcpy (buffer, "# created by brasero\n");
@@ -441,8 +451,20 @@
if (b_written != size)
goto error;
- if (album)
- string = g_strdup_printf ("Albumtitle=\t%s\n", album);
+ if (album) {
+ gchar *encoded;
+
+ encoded = g_convert_with_fallback (album,
+ -1,
+ "ISO-8859-1",
+ "UTF-8",
+ "_", /* Fallback for non convertible characters */
+ NULL,
+ NULL,
+ NULL);
+ string = g_strdup_printf ("Albumtitle=\t%s\n", encoded);
+ g_free (encoded);
+ }
else
string = strdup ("Albumtitle=\t\n");
size = strlen (string);
@@ -451,8 +473,20 @@
if (b_written != size)
goto error;
- if (info->artist)
- string = g_strdup_printf ("Performer=\t%s\n", info->artist);
+ if (info->artist) {
+ gchar *encoded;
+
+ encoded = g_convert_with_fallback (info->artist,
+ -1,
+ "ISO-8859-1",
+ "UTF-8",
+ "_", /* Fallback for non convertible characters */
+ NULL,
+ NULL,
+ NULL);
+ string = g_strdup_printf ("Performer=\t%s\n", encoded);
+ g_free (encoded);
+ }
else
string = strdup ("Performer=\t\n");
size = strlen (string);
@@ -461,8 +495,20 @@
if (b_written != size)
goto error;
- if (info->composer)
- string = g_strdup_printf ("Composer=\t%s\n", info->composer);
+ if (info->composer) {
+ gchar *encoded;
+
+ encoded = g_convert_with_fallback (info->composer,
+ -1,
+ "ISO-8859-1",
+ "UTF-8",
+ "_", /* Fallback for non convertible characters */
+ NULL,
+ NULL,
+ NULL);
+ string = g_strdup_printf ("Composer=\t%s\n", encoded);
+ g_free (encoded);
+ }
else
string = strdup ("Composer=\t\n");
size = strlen (string);
@@ -471,8 +517,20 @@
if (b_written != size)
goto error;
- if (info->title)
- string = g_strdup_printf ("Tracktitle=\t%s\n", info->title);
+ if (info->title) {
+ gchar *encoded;
+
+ encoded = g_convert_with_fallback (info->title,
+ -1,
+ "ISO-8859-1",
+ "UTF-8",
+ "_", /* Fallback for non convertible characters */
+ NULL,
+ NULL,
+ NULL);
+ string = g_strdup_printf ("Tracktitle=\t%s\n", encoded);
+ g_free (encoded);
+ }
else
string = strdup ("Tracktitle=\t\n");
size = strlen (string);
Modified: trunk/src/plugins/cdrtools/burn-cdrecord.c
==============================================================================
--- trunk/src/plugins/cdrtools/burn-cdrecord.c (original)
+++ trunk/src/plugins/cdrtools/burn-cdrecord.c Fri Nov 28 19:15:34 2008
@@ -415,6 +415,16 @@
BRASERO_JOB_LOG (cdrecord, "writing inf (%s)", path);
+ /* The problem here is that when writing CD-TEXT from .inf files, wodim
+ * uses only one charset (and don't let us specify which one) which is
+ * ISO-8859-1. (NOTE: don't believe the doc claiming it requires ASCII
+ * and see cdrecord/cdtext.c line 309).
+ * So we have to convert our UTF-8 input into such a charset.
+ * NOTE: according to docs ASCII should be used for text packs other
+ * than disc/track title.
+ * It might be good in the end to write and pack CD-TEXT pack data
+ * ourselves so we can set a different charset from English like
+ * Chinese for example. */
info = brasero_track_get_audio_info (track);
strcpy (buffer, "# created by brasero\n");
@@ -445,8 +455,20 @@
if (b_written != size)
goto error;
- if (album)
- string = g_strdup_printf ("Albumtitle=\t%s\n", album);
+ if (album) {
+ gchar *encoded;
+
+ encoded = g_convert_with_fallback (album,
+ -1,
+ "ISO-8859-1",
+ "UTF-8",
+ "_", /* Fallback for non convertible characters */
+ NULL,
+ NULL,
+ NULL);
+ string = g_strdup_printf ("Albumtitle=\t%s\n", encoded);
+ g_free (encoded);
+ }
else
string = strdup ("Albumtitle=\t\n");
size = strlen (string);
@@ -455,8 +477,20 @@
if (b_written != size)
goto error;
- if (info->artist)
- string = g_strdup_printf ("Performer=\t%s\n", info->artist);
+ if (info->artist) {
+ gchar *encoded;
+
+ encoded = g_convert_with_fallback (info->artist,
+ -1,
+ "ISO-8859-1",
+ "UTF-8",
+ "_", /* Fallback for non convertible characters */
+ NULL,
+ NULL,
+ NULL);
+ string = g_strdup_printf ("Performer=\t%s\n", encoded);
+ g_free (encoded);
+ }
else
string = strdup ("Performer=\t\n");
size = strlen (string);
@@ -465,8 +499,20 @@
if (b_written != size)
goto error;
- if (info->composer)
- string = g_strdup_printf ("Composer=\t%s\n", info->composer);
+ if (info->composer) {
+ gchar *encoded;
+
+ encoded = g_convert_with_fallback (info->composer,
+ -1,
+ "ISO-8859-1",
+ "UTF-8",
+ "_", /* Fallback for non convertible characters */
+ NULL,
+ NULL,
+ NULL);
+ string = g_strdup_printf ("Composer=\t%s\n", encoded);
+ g_free (encoded);
+ }
else
string = strdup ("Composer=\t\n");
size = strlen (string);
@@ -475,8 +521,20 @@
if (b_written != size)
goto error;
- if (info->title)
- string = g_strdup_printf ("Tracktitle=\t%s\n", info->title);
+ if (info->title) {
+ gchar *encoded;
+
+ encoded = g_convert_with_fallback (info->title,
+ -1,
+ "ISO-8859-1",
+ "UTF-8",
+ "_", /* Fallback for non convertible characters */
+ NULL,
+ NULL,
+ NULL);
+ string = g_strdup_printf ("Tracktitle=\t%s\n", encoded);
+ g_free (encoded);
+ }
else
string = strdup ("Tracktitle=\t\n");
size = strlen (string);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]