You have to know the data type of the thing you are decoding. If it is a 
string, the decoded byte array is a utf8 string with a null terminator. So you 
have to look at it as an array of bytes, and not a number.

If I take the integer 892744497 and convert to hex using little endian, I get 
the bytes { 0x31, 0x33, 0x36, 0x35 }. If I look at this as an array of 
characters, it corresponds to { '1', '3', '6', '5'}.  Does that look familiar?

Traian

From: [email protected] 
[mailto:[email protected]] On Behalf Of Warren Medermach 
(External)
Sent: Friday, March 06, 2009 1:58 PM
To: MapGuide Users Mail List
Subject: RE: [mapguide-users] Base64 encoding decoding scenarios

No ideas, comments, suggestions from anyone?  ;-)

Warren M

From: [email protected] 
[mailto:[email protected]] On Behalf Of Warren Medernach
Sent: Monday, March 02, 2009 10:43 AM
To: MapGuide Users Mail List
Subject: [mapguide-users] Base64 encoding decoding scenarios

I'm working on decoding the UIDs passed in the selection XML, and I want to 
thank the group for all of the posts on decoding base 64 as I can successfully 
decode a UID now!

However, when I attempt to decode a UID that is NOT made up a single integer 
field, I'm running into some problems:

Scenario #1:
If the UID consists of 2 integer fields, upon decoding, only the first value is 
returned.
Example, objects Key fields are:
     UID1: value=1684
     UID2: value=1365

When I decode this, only the first value, 1684, is returned.
Do I need to do something different for decoding a feature where there are 
multiple key fields?

Scenario #2
If the UID consists of a text field, the decoded value is incorrect.
Example, object UID = '1365-1684'
Decoded, the returned value is: 892744497
And I noticed if multiple objects are selected, it seems all of the decoded 
values are: 892744497

Any comments, ideas, suggestions would be greatly appreciated.
Warren M
_______________________________________________
mapguide-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapguide-users

Reply via email to