Re: MARC-perl: different versions yield different results

2010-10-12 Thread Ed Summers
On Tue, Oct 12, 2010 at 9:05 AM, Leif Andersson wrote: > To sum up. > I think it is a good idea to make the MARC blob a binary object, so to speak. > I don't know if you should just apply my simple hacks to CPAN code. > Or if it is called for a thourough re-write of some parts of the modules. > >

Re: MARC-perl: different versions yield different results

2010-10-12 Thread Leif Andersson
Yes, I know... and as I mentioned in my answer to Ed you can just add sub MARC::File::Encode::marc_to_utf8 { return Encode::decode( 'UTF-8', $_[0], 0 ); } to that package MARC_Record_hack Or make the changes directly in MARC::File::Encode.pm I do not feel perfectly comfortable myself with

Re: MARC-perl: different versions yield different results

2010-10-12 Thread Leif Andersson
Hi Ed, Yes I ment that the drawback is in modifying a CPAN module locally. Actually, I don't know if there are any undesireable side effects. None that I know of - I have myself used this technique for almost three years now. The idea is that the MARC::Record object per se should be just binary.

Re: MARC-perl: different versions yield different results

2010-10-12 Thread Al
Thanks, that does indeed do the trick. >MARC::Record 2.0.0, the so called unicode version, introduced the problem you describe. Good to know. I hadn't gleaned that fact from all the messages I'd read. I have a second, related question: MARC::Record 2.0.0 and Encode 2.40 are now more sensit

Re: MARC-perl: different versions yield different results

2010-10-12 Thread Galen Charlton
Hi Leif, On Tue, Oct 12, 2010 at 10:58 AM, Leif Andersson wrote: > To change directly in code like this is totally "no-no" to many programmers. > If you feel uncomfortable with this, there are other methods doing the same > stuff. As it happens, this is the very mailing list where patches to MA

Re: MARC-perl: different versions yield different results

2010-10-12 Thread Ed Summers
On Mon, Oct 11, 2010 at 3:03 PM, Al wrote: > The problem is my record batches are a mixture of UTF8 and MARC8 and > explicitly > setting binmode screws things up. I need a solution that transparently > handles a mix of record encodings. Hmm, yeah the idea w/ MARC::Record v2.x was that binmode wo

Re: MARC-perl: different versions yield different results

2010-10-12 Thread Ed Summers
Hi Leif, Is the downside to this approach that you are modifying a CPAN module in place, or is it something to do with the behavior of 'use bytes'? Would there be any undesirable side effects to adding 'use bytes' to MARC::File::USMARC::encode on CPAN? //Ed On Tue, Oct 12, 2010 at 7:58 AM, Leif

Re: MARC-perl: different versions yield different results

2010-10-12 Thread Leif Andersson
This has nothing to do with Perl versions. MARC::Record 1.38 and earlier does not display this problem. MARC::Record 2.0.0, the so called unicode version, introduced the problem you describe. That is when writing records: causing incorrect leader length and corrupted utf-8 There are different w