cannot find control data "0x0D" using isoMsg.getString(id) method

7 views
Skip to first unread message

jsmith

unread,
Dec 22, 2009, 2:09:09 PM12/22/09
to jPOS Users
Hi all,

I need to get the value of a field of type org.jpos.iso.IFB_LLNUM.
I used isoMsg.getString(field_id), It works fine but this field is
sent with a control character 0x0D that split this field into two
parts, I need to query this filed by this control character.

Please help me how to find this character from the returned string.

Thanks.

David Bergert

unread,
Dec 22, 2009, 2:15:46 PM12/22/09
to jpos-...@googlegroups.com
string.indexOf('\015'); ?

David Bergert, CISSP, CISA, CPISM/A
www.paymentsystemsblog.com

> --
> You received this message because you are subscribed to the "jPOS Users" group.
> Please see http://jpos.org/wiki/JPOS_Mailing_List_Readme_first
> To post to this group, send email to jpos-...@googlegroups.com
> To unsubscribe, send email to jpos-users+...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/jpos-users

jsmith

unread,
Dec 22, 2009, 2:26:59 PM12/22/09
to jPOS Users
I've tried
string.indexOf('\015');
string.indexOf('\013'); , etc
but the problem appears as when i print the contents of this string it
prints equal sign instead of 0x0D character !!

jsmith

unread,
Dec 22, 2009, 2:29:48 PM12/22/09
to jPOS Users
The value from the hexdump:
4041000000000001D0534534534112342340000

while while i looped on the output of getString(field_id), I get :
4041000000000001=0534534534112342340000

the getString() method has replaced 0x0D by =

please help

Mark Salter

unread,
Dec 22, 2009, 3:01:17 PM12/22/09
to jpos-...@googlegroups.com
jsmith wrote:
> The value from the hexdump:
> 4041000000000001D0534534534112342340000
>
> while while i looped on the output of getString(field_id), I get :
> 4041000000000001=0534534534112342340000

It is treating it as a track 2 field...

... perhaps not always desirable. I thought just recently that moving
this translation behaviour to a dedicated field class could be good, but
have not done anything about it yet.

>
> the getString() method has replaced 0x0D by =

Can you just find the "=" instead?


--
Mark

jsmith

unread,
Dec 22, 2009, 3:06:06 PM12/22/09
to jPOS Users

> Can you just find the "=" instead?

There isn't any way to find 0x0D character ??!

David Bergert

unread,
Dec 22, 2009, 3:12:03 PM12/22/09
to jpos-...@googlegroups.com
Can you share the output of ISOUtil.hexdump()

David Bergert, CISSP, CISA, CPISM/A
www.paymentsystemsblog.com

On Dec 22, 2009, at 2:06 PM, jsmith wrote:

>
>> Can you just find the "=" instead?
>
> There isn't any way to find 0x0D character ??!
>

Mark Salter

unread,
Dec 22, 2009, 3:19:02 PM12/22/09
to jpos-...@googlegroups.com
jsmith wrote:
>> Can you just find the "=" instead?
>
> There isn't any way to find 0x0D character ??!

Find a value in a *String* that doesn't contain it...
...no.

You could probably look for your x'0D' in :-

byte[] value;
value = isomsg.getBytes(35);

...but you would have to try it. The field is trying to be 'helpful'
and uses = to represent the BCD 'D' value...
... it might not always be 0x_D you are looking for, it might be 0xD_
(where 0x indicates hexadecimal), depending on the length of the PAN or
whatever precedes the separator.

May I suggest again you use ISOMsg.getString(35) and then find the "="
instead of the 'D'?

You are - I assume as you show no code - asking for a String of the
binary field? The conversion works for some, but not for your need it
seems.

8(

I do think this behaviour should be separated out...

... perhaps I will get around to it next year.

8)

--
Mark

jsmith

unread,
Dec 22, 2009, 4:00:08 PM12/22/09
to jPOS Users
I'll go with "="
Thanks.

Mark Salter

unread,
Dec 22, 2009, 4:07:48 PM12/22/09
to jpos-...@googlegroups.com
jsmith wrote:
> I'll go with "="

What a good idea 8).

> Thanks.
No problem.

--
Mark

Reply all
Reply to author
Forward
0 new messages