Skip Menu |

This queue is for tickets about the Audio-TagLib CPAN distribution.

Report information
The Basics
Id: 79474
Status: resolved
Priority: 0/
Queue: Audio-TagLib

People
Owner: GLEACH [...] cpan.org
Requestors: festushagen2002 [...] yahoo.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.61
Fixed in: 1.62



Subject: iconv_open failure patch
Date: Wed, 5 Sep 2012 21:01:59 -0700 (PDT)
To: "bug-Audio-TagLib [...] rt.cpan.org" <bug-Audio-TagLib [...] rt.cpan.org>
From: Festus Hagen <festushagen2002 [...] yahoo.com>
Audio::TagLib v1.61 OS: Win32, FreeBSD tested. Should work for all. Perl:: Should work for all. iconv: ?? Should work for all. Bug: iconv_open() fails, incorrect character set names, iconv expects a hyphen in UTF names. Patch also resolves: warning: deprecated conversion from string constant to 'char*' Changing where *fromcode is assigned it's value to a hyphenated version causes implications further down the line, including with Taglib. So, My solution ... diff -u -w -r -B --strip-trailing-cr Orig/tstring.xs Modded/tstring.xs --- Orig/tstring.xs    2012-07-04 20:07:44.000000000 -0400 +++ Modded/tstring.xs    2012-09-05 17:59:24.000000000 -0400 @@ -14,7 +14,7 @@  TagLib::String::new(...)  PROTOTYPE: ;$$  PREINIT: -    char *encode, *fromcode; +    const char *encode, *fromcode;      enum TagLib::String::Type t;      bool is_copy_from_string = TRUE;      iconv_t codec; @@ -131,7 +131,18 @@              /* any other encodings converted to utf8 */              //sv_dump(ST(1));              //printf("fromcode = %s\n", fromcode); -            if(!(codec = iconv_open("UTF8", fromcode))) +             const char *from_code; +                        if(strncasecmp(encode, "UTF8", 4) == 0) { +                            from_code = "UTF-8"; +                        } else if(strncasecmp(encode, "UTF16BE", 7) == 0) { +                            from_code = "UTF-16BE"; +                        } else if(strncasecmp(encode, "UTF16LE", 7) == 0) { +                            from_code = "UTF-16LE"; +                        } else if(strncasecmp(encode, "UTF16", 5) == 0) { +                            from_code = "UTF-16"; +                        } else +                            from_code = fromcode; +            if(!(codec = iconv_open("UTF-8", from_code)))                  croak("iconv_open failed, check your encode");              /* inlen MUST be the extract byte length of string */              /* the terminal '\0' should NOT be included in length */ -Enjoy fh :)_~
Subject: Re: [rt.cpan.org #79474] AutoReply: iconv_open failure patch
Date: Wed, 5 Sep 2012 21:20:46 -0700 (PDT)
To: "bug-Audio-TagLib [...] rt.cpan.org" <bug-Audio-TagLib [...] rt.cpan.org>
From: Festus Hagen <festushagen2002 [...] yahoo.com>
Whoops, pasted the wrong diff ... Arrrg! Here is the correct one. diff -u -w -r -B --strip-trailing-cr Orig/tstring.xs Modded/tstring.xs --- Orig/tstring.xs    2012-07-04 20:07:44.000000000 -0400 +++ Modded/tstring.xs    2012-09-05 17:59:24.000000000 -0400 @@ -14,7 +14,7 @@  TagLib::String::new(...)  PROTOTYPE: ;$$  PREINIT: -    char *encode, *fromcode; +    const char *encode, *fromcode;      enum TagLib::String::Type t;      bool is_copy_from_string = TRUE;      iconv_t codec; @@ -131,7 +131,18 @@              /* any other encodings converted to utf8 */              //sv_dump(ST(1));              //printf("fromcode = %s\n", fromcode); -            if(!(codec = iconv_open("UTF8", fromcode))) +             const char *from_code; +             if(strncasecmp(fromcode, "UTF8", 4) == 0) { +                 from_code = "UTF-8"; +             } else if(strncasecmp(fromcode, "UTF16BE", 7) == 0) { +                 from_code = "UTF-16BE"; +             } else if(strncasecmp(fromcode, "UTF16LE", 7) == 0) { +                 from_code = "UTF-16LE"; +             } else if(strncasecmp(fromcode, "UTF16", 5) == 0) { +                 from_code = "UTF-16"; +             } else +                 from_code = fromcode; +            if(!(codec = iconv_open("UTF-8", from_code)))                  croak("iconv_open failed, check your encode");              /* inlen MUST be the extract byte length of string */              /* the terminal '\0' should NOT be included in length */ Sorry! -Enjoy fh :)_~ Show quoted text
----- Original Message ----- From: Bugs in Audio-TagLib via RT <bug-Audio-TagLib@rt.cpan.org> To: festushagen2002@yahoo.com Cc: Sent: Thursday, September 6, 2012 12:02 AM Subject: [rt.cpan.org #79474] AutoReply: iconv_open failure patch Greetings, This message has been automatically generated in response to the creation of a trouble ticket regarding:     "iconv_open failure patch", a summary of which appears below. There is no need to reply to this message right now.  Your ticket has been assigned an ID of [rt.cpan.org #79474].  Your ticket is accessible on the web at:     https://rt.cpan.org/Ticket/Display.html?id=79474 Please include the string:         [rt.cpan.org #79474] in the subject line of all future correspondence about this issue. To do so, you may reply to this message.                         Thank you,                         bug-Audio-TagLib@rt.cpan.org ------------------------------------------------------------------------- Audio::TagLib v1.61 OS: Win32, FreeBSD tested. Should work for all. Perl:: Should work for all. iconv: ?? Should work for all. Bug: iconv_open() fails, incorrect character set names, iconv expects a hyphen in UTF names. Patch also resolves: warning: deprecated conversion from string constant to 'char*' Changing where *fromcode is assigned it's value to a hyphenated version causes implications further down the line, including with Taglib. So, My solution ... diff -u -w -r -B --strip-trailing-cr Orig/tstring.xs Modded/tstring.xs --- Orig/tstring.xs    2012-07-04 20:07:44.000000000 -0400 +++ Modded/tstring.xs    2012-09-05 17:59:24.000000000 -0400 @@ -14,7 +14,7 @@  TagLib::String::new(...)  PROTOTYPE: ;$$  PREINIT: -    char *encode, *fromcode; +    const char *encode, *fromcode;      enum TagLib::String::Type t;      bool is_copy_from_string = TRUE;      iconv_t codec; @@ -131,7 +131,18 @@              /* any other encodings converted to utf8 */              //sv_dump(ST(1));              //printf("fromcode = %s\n", fromcode); -            if(!(codec = iconv_open("UTF8", fromcode))) +             const char *from_code; +                        if(strncasecmp(encode, "UTF8", 4) == 0) { +                            from_code = "UTF-8"; +                        } else if(strncasecmp(encode, "UTF16BE", 7) == 0) { +                            from_code = "UTF-16BE"; +                        } else if(strncasecmp(encode, "UTF16LE", 7) == 0) { +                            from_code = "UTF-16LE"; +                        } else if(strncasecmp(encode, "UTF16", 5) == 0) { +                            from_code = "UTF-16"; +                        } else +                            from_code = fromcode; +            if(!(codec = iconv_open("UTF-8", from_code)))                  croak("iconv_open failed, check your encode");              /* inlen MUST be the extract byte length of string */              /* the terminal '\0' should NOT be included in length */ -Enjoy fh :)_~
Subject: Re: [rt.cpan.org #79474] AutoReply: iconv_open failure patch
Date: Thu, 6 Sep 2012 09:51:49 -0700 (PDT)
To: "bug-Audio-TagLib [...] rt.cpan.org" <bug-Audio-TagLib [...] rt.cpan.org>
From: Festus Hagen <festushagen2002 [...] yahoo.com>
Was going to include this in another patch, decided it was more appropriate with this one ... diff -u -w -r --strip-trailing-cr Orig/stringiterator.xs Modded/stringiterator.xs --- Orig/stringiterator.xs    2012-07-04 20:07:44.000000000 -0400 +++ Modded/stringiterator.xs    2012-09-01 17:40:01.000000000 -0400 @@ -50,7 +50,7 @@  //USEWCHAR      /* iterator for String */      wchar_t & data = **THIS; -    iconv_t codec = iconv_open("UTF8", "WCHAR_T"); +    iconv_t codec = iconv_open("UTF-8", "WCHAR_T");      if(codec == (iconv_t)(-1))          croak("iconv_open failed");      char *inbuf, *outbuf; -Enjoy fh :)_~ Show quoted text
----- Original Message ----- From: Bugs in Audio-TagLib via RT <bug-Audio-TagLib@rt.cpan.org> To: festushagen2002@yahoo.com Cc: Sent: Thursday, September 6, 2012 12:02 AM Subject: [rt.cpan.org #79474] AutoReply: iconv_open failure patch Greetings, This message has been automatically generated in response to the creation of a trouble ticket regarding:     "iconv_open failure patch", a summary of which appears below. There is no need to reply to this message right now.  Your ticket has been assigned an ID of [rt.cpan.org #79474].  Your ticket is accessible on the web at:     https://rt.cpan.org/Ticket/Display.html?id=79474 Please include the string:         [rt.cpan.org #79474] in the subject line of all future correspondence about this issue. To do so, you may reply to this message.                         Thank you,                         bug-Audio-TagLib@rt.cpan.org ------------------------------------------------------------------------- Audio::TagLib v1.61 OS: Win32, FreeBSD tested. Should work for all. Perl:: Should work for all. iconv: ?? Should work for all. Bug: iconv_open() fails, incorrect character set names, iconv expects a hyphen in UTF names. Patch also resolves: warning: deprecated conversion from string constant to 'char*' Changing where *fromcode is assigned it's value to a hyphenated version causes implications further down the line, including with Taglib. So, My solution ... diff -u -w -r -B --strip-trailing-cr Orig/tstring.xs Modded/tstring.xs --- Orig/tstring.xs    2012-07-04 20:07:44.000000000 -0400 +++ Modded/tstring.xs    2012-09-05 17:59:24.000000000 -0400 @@ -14,7 +14,7 @@  TagLib::String::new(...)  PROTOTYPE: ;$$  PREINIT: -    char *encode, *fromcode; +    const char *encode, *fromcode;      enum TagLib::String::Type t;      bool is_copy_from_string = TRUE;      iconv_t codec; @@ -131,7 +131,18 @@              /* any other encodings converted to utf8 */              //sv_dump(ST(1));              //printf("fromcode = %s\n", fromcode); -            if(!(codec = iconv_open("UTF8", fromcode))) +             const char *from_code; +                        if(strncasecmp(encode, "UTF8", 4) == 0) { +                            from_code = "UTF-8"; +                        } else if(strncasecmp(encode, "UTF16BE", 7) == 0) { +                            from_code = "UTF-16BE"; +                        } else if(strncasecmp(encode, "UTF16LE", 7) == 0) { +                            from_code = "UTF-16LE"; +                        } else if(strncasecmp(encode, "UTF16", 5) == 0) { +                            from_code = "UTF-16"; +                        } else +                            from_code = fromcode; +            if(!(codec = iconv_open("UTF-8", from_code)))                  croak("iconv_open failed, check your encode");              /* inlen MUST be the extract byte length of string */              /* the terminal '\0' should NOT be included in length */ -Enjoy fh :)_~
Subject: Re: [rt.cpan.org #79474] AutoReply: iconv_open failure patch
Date: Sat, 08 Sep 2012 15:53:01 -0700
To: bug-Audio-TagLib [...] rt.cpan.org
From: Geoffrey Leach <geoff [...] hughes.net>
Hi Festus. I've applied (I think) your two iconv patches. Patched files are attached. Kindly verify. Did you know that your editor is inserting odd characters? Compile errors: ./xs/tstring.xs:140:1: error: stray ‘\302’ in program, etc. The characters appear to be c2 (LATIN CAPITAL LETTER A WITH CIRCUMFLEX) and a0 (NO-BREAK SPACE) and are being used for space- padding at the beginning of line. These are iso_8859-1 and are not accepted by g++ on Linux. Please let me know if you can suppress them, or I'll write a filter.

Message body is not shown because sender requested not to inline it.

Message body is not shown because sender requested not to inline it.

Subject: Re: [rt.cpan.org #79474] AutoReply: iconv_open failure patch
Date: Sat, 8 Sep 2012 20:04:23 -0700 (PDT)
To: "bug-Audio-TagLib [...] rt.cpan.org" <bug-Audio-TagLib [...] rt.cpan.org>
From: Festus Hagen <festushagen2002 [...] yahoo.com>
Just using Yahoo's web editor ... I have it set to plain text but their idea of plain text is far from mine! stringiterator.xs looks good. Don't know if Attachments get through, I'll try, Attached is your copy of tstring.xs, I cleaned up the alignment and moved the "// end of Festus-02" to the end of the changes, otherwise it looks good. If it doesn't make it. I'll email it to you directly ... It would not bother me at all to delete this whole mess and allow me to start over, it was the first submission on this system and I really made a mess of it ... O-wells, live and learn. -Enjoy fh :)_~ Show quoted text
----- Original Message ----- From: "geoff@hughes.net via RT" <bug-Audio-TagLib@rt.cpan.org> To: festushagen2002@yahoo.com Cc: Sent: Saturday, September 8, 2012 6:53 PM Subject: Re: [rt.cpan.org #79474] AutoReply: iconv_open failure patch <URL: https://rt.cpan.org/Ticket/Display.html?id=79474 > Hi Festus. I've applied (I think) your two iconv patches. Patched files are attached.  Kindly verify. Did you know that your editor is inserting odd characters? Compile errors: ./xs/tstring.xs:140:1: error: stray ‘\302’ in program, etc. The characters appear to be c2 (LATIN CAPITAL LETTER A WITH CIRCUMFLEX) and a0 (NO-BREAK SPACE) and are being used for space- padding at the beginning of line. These are iso_8859-1 and are not accepted by g++ on Linux. Please let me know if you can suppress them, or I'll write a filter.

Message body is not shown because sender requested not to inline it.