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

RE: Sending Big5 through httpapi



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
-----------------------------------------------------------------------