John,
What you are missing is that the underlying code point ("hex value") of the dollar sign is different in US EBCDIC than it is in UK EBCDIC. You have a UK e-mail address, so I assume you are actually in the UK. However, you are telling your computer that you are in the USA. Is it really a surprise that the hex value of the dollar sign is being misinterpreted as a different character?
If you want to force HTTPAPI to interpret your data is UK English (even though you've explicitly told it otherwise) you can do that by setting a UK CCSID.
http_setCCSIDs(1208: 1146);
That said, a much smarter idea is to set up your IBM i correctly
for the workload its handling.
-- Scott Klement sk@xxxxxxxxxxxxxxxx
The system is setup for ENU, when I try to authenticate with basic authentication I was receiving “this website requires a username and password”
I then used Postman to connect via my PC using the same credentials and it worked.
I looked at the base64 encoded string for both and there was one character that was different, it turned out to be a dollar sign,
After a lot of head scratching I changed my job to ENG , ran it again, it created the correct auth credentials, ie the dollar sign mapped to x’24’ , and I connected to the service.
What am I missing ?
Regards,
John
On 10 Jan 2021, at 04:25, Scott Klement <sk@xxxxxxxxxxxxxxxx> wrote:
Hello,
Can you explain why this is happening? Do you have your system configured for US-English (ENU) but have your 5250 terminal set up for GB-English (ENG)? Or, what is the reason you want your job to be set up as a US job, but want it to output as if its a GB job?
-- Scott Klement sk@xxxxxxxxxxxxxxxxOn 1/8/2021 10:03 AM, John Long wrote:
--
> Hi,
>
> I'm using the HTTPAPI code to connect to service that requires basic authentication and authentication is failing,
>
> There is a $ (Dollar) sign in my EBCDIC auth string
>
> if I CHGJOB LANGID(ENU) CNTRYID(US) it fails conversion changes it to x'A2'
>
> If I use CHGJOB LANGID(ENG) CNTRYID(GB) it works as the conversion sets it to x'24'
>
> Is there something I can set within my RPG to perform the equivalent task without having to change my job each time.
>
> --
> Regards
>
> John Long
>
The information contained in this communication from john.long@xxxxxxxxxxxxxx sent at 2021-01-08 16:03:12 is confidential and may be legally privileged or protected by other legal rules. This e-mail (and any attachments) is intended solely for use by ftpapi@xxxxxxxxxxxxxxxxxxxxxx and may contain personal views which are not the views of the TJ Morris Ltd unless specifically stated. If you are not ftpapi@xxxxxxxxxxxxxxxxxxxxxx, please contact the sender by reply e-mail and destroy all copies of the original message. You should not copy it or disclose its contents to any other person.
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
https://protect-eu.mimecast.com/s/GM6cCx6WohoKVRU8xj4P?domain=scottklement.com
The information contained in this communication from john.long@xxxxxxxxxxxxxx sent at 2021-01-10 08:36:59 is confidential and may be legally privileged or protected by other legal rules. This e-mail (and any attachments) is intended solely for use by ftpapi@xxxxxxxxxxxxxxxxxxxxxx and may contain personal views which are not the views of the TJ Morris Ltd unless specifically stated. If you are not ftpapi@xxxxxxxxxxxxxxxxxxxxxx, please contact the sender by reply e-mail and destroy all copies of the original message. You should not copy it or disclose its contents to any other person.
-- _______________________________________________ Ftpapi mailing list Ftpapi@xxxxxxxxxxxxxxxxxxxxxx http://scottklement.com/mailman/listinfo/ftpapi