[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Ftpapi] Help with CCSIDs or URL encoding



Hi Drew,

 

What is your session CCSID?

 

You can have this kind of mismatch between United Kingdom CCSID 1146 (session) and USA CCSID 037 (job):

 

A2 for CCSID 1146 = $

A2 for CCSID 0037 = ¢

 

Thanks.

 

Best Regards

Wim

 

 

From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx <ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx> On Behalf Of Frank Broome
Sent: woensdag 15 januari 2020 16:11
To: FTPAPI/HTTPAPI mailing list <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
Subject: [EXTERNAL] Re: [Ftpapi] Help with CCSIDs or URL encoding

 

Note that if you want to hardcode a value with “special” characters in a source file then you will get issues if the job that eventually runs the program is running in a different CCSID than the source file is.

Either you store your special characters in a file with CCSID (not 65535) or you have to ensure that the CCSID of the source matches the job CCSID that runs the program.

 

Best regards,

Frank

 

From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx <ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx> On Behalf Of Diarmuid Drew
Sent: Wednesday, January 15, 2020 6:05 AM
To: FTPAPI/HTTPAPI mailing list <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: [Ftpapi] Help with CCSIDs or URL encoding

 

I’ve tried that with a few lines of code,

 

URL = "" +'/'+ %trimr(apiVersion) +'/'+

       %trimr(mailResc) + '?';                       

 URL = "" + http_urlEncode('$select');      

 URL = "" + http_urlEncode('&$filter');     

 clear response;                                   

 response = http_string('GET'                      

                       : URL                       

                       : *omit                     

                       : *omit);                   

 

And I get the following in the debug log

 

GET /v1.0/me/messages?%A2select%26%A2filter HTTP/1.1

Host: graph.microsoft.com                           

User-Agent: http-api/1.39                            

 

The $ sign is still converted to a %A2

 

 

 

From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx <ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx> On Behalf Of Frank Broome
Sent: 13 January 2020 16:01
To: FTPAPI/HTTPAPI mailing list <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: [Ftpapi] Help with CCSIDs or URL encoding

 

Hi,

 

I believe you need to put message in a variable, e.g. ‘variable’ and use pParm1 = http_urlEncode(variable)

URL = '' + 

      pParm1;

 

Also note that if you hardcode a value it will get the CCSID of the source and if you then run it in a job with different CCSID the runtime value will change, potentially.

 

Best regards,

Frank

 

From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx <ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx> On Behalf Of Diarmuid Drew
Sent: Saturday, January 11, 2020 7:08 AM
To: ftpapi@xxxxxxxxxxxxxxxxxxxxxx
Subject: [Ftpapi] Help with CCSIDs or URL encoding

 

Hi,

 

I’m new to HTTPAPI and sure that this has been asked a few times but my mailing list searches have not provided an answer, possibly my powers are weak. I’m trying to consume a RESTful service and my selection is not working, I get a response from the server but it is not filtering as I requested, ie it is responding with all emails and all fields.

 

The URL I’m accessing is

https://graph.microsoft.com/v1.0/me/messages?$select=sender,subject&$filter=importance eq 'high'

but in the debug log it is showing

GET /v1.0/me/messages?¢select=sender,subject&¢filter=importance%20eq%20'high' HTTP/1.1

The dollar characters are being shown as ¢ (cent)

 

The debug file is CCSID 819 and my job is 37, looking at the debug log in hex it shows

- - - -  + - - -  - * - -  - - + -  - - - *    ----+----*----+----*

65733FA2 73656C65 63743D73 656E6465 722C7375   es?$select=sender,su

 

The dollar is showing as A2 which is the cent sign in the extended ASCII table.

 

My code looks like this (CCSID 37 source file)

 

D URL             S            300a    varying

D response        S         100000a    varying

 

URL = '' + 

      '$select=sender,subject&' +                       

      '$filter=importance eq ''high''';                                     

http_xproc(HTTP_Point_Addl_Header:%paddr(add_hdr));                                           

monitor;                                                

   response = http_string('GET'                         

                         : URL                          

                         : *omit                        

                         : *omit);                      

on-error;                                               

  errorMsg = http_error();                              

  sndmsg(errorMsg);                                      

endmon;

 

 

What should I do to get the correct this?

Thanks

 

 

Disclaimer

The information contained in this communication from the sender is confidential. It is intended solely for use by the recipient and others authorized to receive it. If you are not the recipient, you are hereby notified that any disclosure, copying, distribution or taking action in relation of the contents of this information is strictly prohibited and may be unlawful.

This email has been scanned for viruses and malware, and may have been automatically archived by Mimecast Ltd, an innovator in Software as a Service (SaaS) for business. Providing a safer and more useful place for your human generated data. Specializing in; Security, archiving and compliance. To find out more Click Here.

 

Disclaimer

The information contained in this communication from the sender is confidential. It is intended solely for use by the recipient and others authorized to receive it. If you are not the recipient, you are hereby notified that any disclosure, copying, distribution or taking action in relation of the contents of this information is strictly prohibited and may be unlawful.

This email has been scanned for viruses and malware, and may have been automatically archived by Mimecast Ltd, an innovator in Software as a Service (SaaS) for business. Providing a safer and more useful place for your human generated data. Specializing in; Security, archiving and compliance. To find out more Click Here.

-- 
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi