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

Re: Sending Big5 through httpapi



As I said in the previous message, you have to be running the current 
*beta* version for HTTP_setCCSIDs() to work with the URL encoder.
You can retrieve the current beta here:
http://www.scottklement.com/httpapi/beta

You need to call the URL encoding routines to fill in the data.  To call 
them (remember, you need the *beta* for setCCSIDs to work) you should do 
this:

  a) Call http_setCCSIDs()
  b) Call HTTP_url_encoder_new() or webform_open()
  c) Call HTTP_url_encoder_addvar, http_url_encoder_addvar_s,
          webform_setPtr, or webform_setvar for each variable
          you wish to set in the URL
  d) Call HTTP_url_encoder_getstr() or webform_getdta() to
          retrieve the encoded data so you can add it to
          your URI
  e) Call http_url_encoder_free() or webform_close() to
          clean up the memory used by the encoder.



On 9/13/2010 3:58 AM, CISD Hang Lam Chan wrote:
> Hi,
>
> Using&msg=%a7%da' is fine, however, ss the user will input message content, the data will be changed and I cannot hard-coded as&msg=%a7%da';
>
> I did try to use http_setCCSIDs() to set the CCSID, but it doesn't work.
> And, as you said I am not calling the URL encoding routines, could you let me know which routine should I call so that I can use the http_setCCSIDs() correctly?
>
> Regards
>
> -----Original Message-----
> From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Scott Klement
> Sent: Saturday, September 11, 2010 1:52 AM
> To: HTTPAPI and FTPAPI Projects
> Subject: Re: Sending Big5 through httpapi
>
> Hello,
>
>>      I am using version 1.23 and trying to send out data by RPG using
>>      HTTPAPI from AS400 to a PC with CCSID 950
>
> HTTPAPI does not attempt to URL-encode your URI automatically.  It
> assumes that you are passing a valid URL to it, that's already been
> encoded accordingly.
>
> The HTTP standard does not allow characters that are not part of
> ISO-8859-1 (CCSID 819) in a URI.  The standards state that the HTTP
> protocol will always use ISO-8859-1.
>
> If you use the current BETA version of HTTPAPI, and you call the URL
> encoding routines (which you are not currently doing) it'll allow you to
> set an alternative CCSID via http_setCCSIDs() to use UTF-8 data, and
> then it'll encode it for you to make it a valid URL.  But since you are
> not even attempting to call those routines now, HTTPAPI is definitely
> going to mistranslate your URL.
>
> If your data never changes, you could do this:
>
>     Eval      URL = 'http://somewhere.com'
>                    + '/app/servlet/GenSendSM?'
>                    + 'acc=my_acc'
>                    + '&pwd=my_pwd'
>                    + '&msisdn='
>                    + '&msg=%a7%da';
>
> This is (presumably) what the URL encoder would arrive at if you updated
> and used the URL encoder...
>
> -----------------------------------------------------------------------
> This is the FTPAPI mailing list.  To unsubscribe, please go to:
> http://www.scottklement.com/mailman/listinfo/ftpapi
> -----------------------------------------------------------------------
> -----------------------------------------------------------------------
> This is the FTPAPI mailing list.  To unsubscribe, please go to:
> http://www.scottklement.com/mailman/listinfo/ftpapi
> -----------------------------------------------------------------------
>

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------