2

In Intersystem Cache i export some GLOBALs using

$system.OBJ.Export("GCL.GLB", "C:\GCL.xml")

Now there is a field that is BASE64 encoded, for example the following row:

<Node><Sub>2</Sub>
<DataBase64>AgEDATECAQgBU2luZ2xlBATD+QQEkH4EBCD9BAQcAgIEBQE2RE4CAQIBAgECAQIBYwEJAWFmd2V6
aWcCASoBX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwIBFQFIb2dlIEhv
bmRzdHJhYXQgMTE1EwE3NDEzIENFLCBERVZFTlRFUgIBBQExQVMFATVBQwYBMzhHQg0BNjM4ODEs
MzU4NjM=
</DataBase64>
</Node>

When i decode the base64 data in UTF-8 i do not get all data, i heard that it needs to be decoded in IBM437 but then i still miss the first 3 fields which should be 3 numbers with a length of 5

Does someone know which encoding is right or how i can see what encoding i need for this?

Thanks

Joey Erdogan
  • 184
  • 1
  • 13

1 Answers1

1

I don't see any issues with this Base64, you have data in $LB format there.

USER>s b64="AgEDATECAQgBU2luZ2xlBATD+QQEkH4EBCD9BAQcAgIEBQE2RE4CAQIBAgECAQIBYwEJAWFmd2V6aWcCASoBX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwIBFQFIb2dlIEhvbmRzdHJhYXQgMTE1EwE3NDEzIENFLCBERVZFTlRFUgIBBQExQVMFATVBQwYBMzhHQg0BNjM4ODEsMzU4NjM="

USER>s data=$system.Encryption.Base64Decode(b64)                                 

USER>zw data                                                                    
data=$lb("","1","","Single",63939,32400,64800,540,0,"6DN","","","","","",$lb("afwezig","","________________________________________","","Hoge Hondstraat 115","7413 CE, DEVENTER",""),"1AS","5AC","38GB","63881,35863")
DAiMor
  • 3,185
  • 16
  • 24
  • Hmm seems to work using the terminal indeed, but if i throw the data through online conversions i do not get it as LB data? Any idea how to get this LB data out of intersystems in readable format. Is there a way to stop the Export function to make it base64? – Joey Erdogan May 09 '18 at 15:07
  • $lb is a binary format, and quite simple to make it readeble in another language. And because it's binary you can't stop to encode it in Base64, because xml is a text format. For understanding $lb use this command in terminal. `zzdump $lb(123,"345","test")` – DAiMor May 09 '18 at 16:25
  • I got it, :) Based on the first byte (Length of hex string) and the 2nd byte (Type 01 = text 04 = number) i can read out the data! Thank you very much!! – Joey Erdogan May 11 '18 at 07:40