Skip Menu |

This queue is for tickets about the Device-Gsm CPAN distribution.

Report information
The Basics
Id: 57585
Status: resolved
Worked: 3 hours (180 min)
Priority: 0/
Queue: Device-Gsm

People
Owner: cosimo [...] cpan.org
Requestors: Erich.Koessldorfer [...] drei.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: bug report for Device/Gsm/Pdu.pm, Version 1.54
Date: Tue, 18 May 2010 16:21:16 +0200
To: "bug-Device-Gsm [...] rt.cpan.org" <bug-Device-Gsm [...] rt.cpan.org>
From: "Koessldorfer,Erich" <Erich.Koessldorfer [...] drei.com>
Hi COSIMO! I'd like to report a bug in the module Pdu.pm. The bug is related to bug 20906, "Problem with Russian letters in SMS". The correction made there is not correct. When reading messages with $gsm->messages() characters above 0x80 are not displayed correctly, they are not converted to UTF-8. The reason is a wrong format at the pack statement. Line 167 now looks like: $decoded.=pack("U",hex(substr($encoded,0,4))); but should look like: $decoded.=pack("C0U",hex(substr($encoded,0,4))); I tested with the string Øñóº which are all characters between 0x80 and 0xff. Version 1.54 returns the message text as Windows-1252 encoded. With the format "C0U" the correct UTF-8 encoded text is returned. The code looks like: my $gsm = new Device::Gsm(...); my @msg = $gsm->messages(); foreach( @msg ) { printf("%s\n", $_->text()); } When piped through "od -c" command, the output looks like: 330 361 363 272 which is wrong, correct output is: 303 230 303 261 303 263 302 272 Kind regards, Erich Kößldorfer
On Tue May 18 10:21:20 2010, Erich.Koessldorfer@drei.com wrote: Show quoted text
> I'd like to report a bug in the module Pdu.pm. The bug is related to > bug 20906, "Problem with Russian letters in SMS". The correction > made there is not correct.
Hi Erich, fantastic report, thanks! I'll look into this tonight.
Il Mar 18 Maggio 2010 11:03:17, COSIMO ha scritto: Show quoted text
> On Tue May 18 10:21:20 2010, Erich.Koessldorfer@drei.com wrote: >
> > I'd like to report a bug in the module Pdu.pm. The bug is related to > > bug 20906, "Problem with Russian letters in SMS". The correction > > made there is not correct.
> > Hi Erich, > > fantastic report, thanks! > I'll look into this tonight.
I tried to come up with a test script, but I couldn't build a self-contained test case with the exact string you gave me. Please can you try to write a test script (t/rt_57585.t, like the ones in t/*.t)? Ideally it should be a script that fails with the unpatched version and succeeds with your patch to Pdu.pm applied. Alternatively, could you describe the source string and result of applying Device::Gsm::Pdu::decode_text_UCS2() to it? Thanks,
Subject: RE: [rt.cpan.org #57585] bug report for Device/Gsm/Pdu.pm, Version 1.54
Date: Tue, 25 May 2010 10:54:28 +0200
To: "bug-Device-Gsm [...] rt.cpan.org" <bug-Device-Gsm [...] rt.cpan.org>
From: "Koessldorfer,Erich" <Erich.Koessldorfer [...] drei.com>
Hi Cosimo! Sorry for the late reply, I was sick at home and cpouldn't read my email.... I have attached a script with 4 tests with characters from different ranges in the unicode table. I hope they explain themselves, if not, please tell me. By the way, your module cannot be used with option -w, which IMHO is not very handy, but easy to correct. Try it out... Regards, Erich. Show quoted text
-----Original Message----- From: Cosimo Streppone via RT [mailto:bug-Device-Gsm@rt.cpan.org] Sent: Mittwoch, 19. Mai 2010 00:02 To: Koessldorfer,Erich Subject: [rt.cpan.org #57585] bug report for Device/Gsm/Pdu.pm, Version 1.54 <URL: https://rt.cpan.org/Ticket/Display.html?id=57585 > Il Mar 18 Maggio 2010 11:03:17, COSIMO ha scritto:
> On Tue May 18 10:21:20 2010, Erich.Koessldorfer@drei.com wrote: >
> > I'd like to report a bug in the module Pdu.pm. The bug is related to > > bug 20906, "Problem with Russian letters in SMS". The correction > > made there is not correct.
> > Hi Erich, > > fantastic report, thanks! > I'll look into this tonight.
I tried to come up with a test script, but I couldn't build a self-contained test case with the exact string you gave me. Please can you try to write a test script (t/rt_57585.t, like the ones in t/*.t)? Ideally it should be a script that fails with the unpatched version and succeeds with your patch to Pdu.pm applied. Alternatively, could you describe the source string and result of applying Device::Gsm::Pdu::decode_text_UCS2() to it? Thanks,

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

Subject: RE: [rt.cpan.org #57585] bug report for Device/Gsm/Pdu.pm, Version 1.54
Date: Tue, 25 May 2010 17:12:58 +0200
To: "bug-Device-Gsm [...] rt.cpan.org" <bug-Device-Gsm [...] rt.cpan.org>
From: "Koessldorfer,Erich" <Erich.Koessldorfer [...] drei.com>
My report was assuming that messages, containing non-ISO-8859-1 characters should be encoded in UTF-8, so that the content will not be lost. I am not sure what's the authors intention here, maybe the module works as designed. Anyway, I would suggest to return all messages in UTF-8 or offer a method for getting the message encoding. Regards. Show quoted text
-----Original Message----- From: Cosimo Streppone via RT [mailto:bug-Device-Gsm@rt.cpan.org] Sent: Mittwoch, 19. Mai 2010 00:02 To: Koessldorfer,Erich Subject: [rt.cpan.org #57585] bug report for Device/Gsm/Pdu.pm, Version 1.54 <URL: https://rt.cpan.org/Ticket/Display.html?id=57585 > Il Mar 18 Maggio 2010 11:03:17, COSIMO ha scritto:
> On Tue May 18 10:21:20 2010, Erich.Koessldorfer@drei.com wrote: >
> > I'd like to report a bug in the module Pdu.pm. The bug is related to > > bug 20906, "Problem with Russian letters in SMS". The correction > > made there is not correct.
> > Hi Erich, > > fantastic report, thanks! > I'll look into this tonight.
I tried to come up with a test script, but I couldn't build a self-contained test case with the exact string you gave me. Please can you try to write a test script (t/rt_57585.t, like the ones in t/*.t)? Ideally it should be a script that fails with the unpatched version and succeeds with your patch to Pdu.pm applied. Alternatively, could you describe the source string and result of applying Device::Gsm::Pdu::decode_text_UCS2() to it? Thanks,
Should be fixed in the upcoming CPAN version 1.57. Thanks again Eric. It took a while, but we got there in the end. Hopefully :)