Hi Dan,
Yes, I do want to start from incoming SMS messages, therefore GSM
characters. If its my misunderstanding that means I can't convert GSM
characters into Perl format and back again without having to tweek
internal flags in perl I think its time I found a more sane language to
write in!
Seriously, please will you tell me what information I need to add to my
GSM characters to tell decode to convert them in such a way that encode
can reverse the process?
Thanks,
Michael
Show quoted text> <URL:
http://rt.cpan.org/Ticket/Display.html?id=18567 >
>
> On Thu Oct 05 06:26:36 2006, michael@email4all.org wrote:
>> Hi Dan,
>> Sorry for the delay, I've been away for a while.
>> Please try this code. Why doesn't encode do the reverse operation from
decode for these 6 characters?
Show quoted text>> #!/usr/bin/perl
>> #
>> # Simple test program that executes encode and decode gsm338
>> #
>> # ******************************************
>> require Encode;
>> for ($i=0;$i<128;$i++)
>> { $gsmtxt = chr($i);
>> $msgtxt = Encode::decode("gsm0338", $gsmtxt);
>
> decode? not encode? Here you are treating $i as GSM character, not
UTF-8
Show quoted text> Character. This
> code does not make sense to me.
>
>> $msgord = ord($msgtxt);
>> $ngsmtxt = Encode::encode("gsm0338", $msgtxt);
>> $ngsmord = ord($ngsmtxt);
>> if (($i != $ngsmord) and ($i != 0x1b))
>> { printf "%4x%4x", $i,$msgord;
>> #print " $msgtxt";
>> printf "%4x\n", $ngsmord;
>> }
>> }
>> Michael
>
> Till you convince me it's Encode's bug, not your misunderstanding, I'll
close this ticket.
Show quoted text> Please open a new ticket if you find a new evidence.
>
> Dan the Encode Maintainer
>