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

Re: httpapi - problem with french special characters



Hi Cyril,

> My request should contains 'test%C3A9test' in 'lib' and 'txt', but it
> contains 'test%C3%A9z%3A%A3'.
> When I used 819 in my ASCII CCSID, I obtain 'test%E9test' but '%E9' is
> not understand on my web application.

I'm trying to help you, further with your CCSID problem.  Perhaps it's 
because I'm using the current BETA of HTTPAPI, but... I'm not having the 
same problems?

I wrote a test program (the code will follow) to try to tell me what's 
going on.  When I run it under my normal (CCSID 37, USA) terminal, this 
is the output of my test program:

  in EBCDIC, é is 51
  in EBCDIC, @ is 7C

lib=test%C3%A9test&ccr=75&del=0&ede=destinataire%40domain.com&eem=em
etteur%40domain.com&txt=test%C3%A9test

As far as I can tell, that's what you're hoping to get, but... you're 
not?  When I create a session with a CCSID 297 emulator, and job 
CCSID=297, this is what the output of my test program looks like:

  in EBCDIC, é is C0
  in EBCDIC, @ is 44
  lib=test%C3%A9test&ccr=75&del=0&ede=destinataire%40domain.com&eem=em
  etteur%40domain.com&txt=test%C3%A9test

Of course, I don't know what the *actual* hex values you're using are, 
but according to my chart for CCSID 297, x'C0' is the proper value for 
é, and x'44' is the proper value for @.  (And the CCSID 37 values are, 
likewise, correct.)

Here's the test program that I used, PLEASE TRY IT AND SEE WHAT YOU GET! 
  Also, if you get bad results with this test program, PLEASE try it 
again with the current HTTPAPI beta version from the following link:
http://www.scottklement.com/httpapi/beta

No matter what results you get (good or bad) please post them here so we 
know what's happening...  thanks!

      H DFTACTGRP(*NO) BNDDIR('HTTPAPI':'QC2LE')

       /define WEBFORMS
       /copy HTTPAPI_H

      D cvthc           PR                  ExtProc('cvthc')
      D   target                       2A
      D   src_bits                     1A   const
      D   tgt_length                  10I 0 value

      D QUILNGTX        PR                  ExtPgm('QUILNGTX')
      D   text                     65535a   const options(*varsize)
      D   length                      10i 0 const
      D   msgid                        7a   const
      D   qualmsgf                    20a   const
      D   errorCode                   20i 0 const

      D UCS_AT          c                   u'0040'
      D UCS_EACUTE      c                   u'00e9'
      D charval         s              1a
      D hexval          s              2a
      D testmsg         s            200a   varying

      D form            s                   like(WEBFORM)
      D myPointer       s               *
      D dataSize        s             10i 0
      D debug           s           1000a   based(myPointer)
      D w_text          s            100a   varying
      D pText           s               *

       /free

          charval = %char(UCS_EACUTE);
          cvthc(hexval: charval: 2);
          testmsg = 'in EBCDIC, ' + %char(UCS_EACUTE)
                  +        ' is ' + hexval;
          QUILNGTX( testmsg: %len(testmsg): ' ': ' ': 0);

          charval = %char(UCS_AT);
          cvthc(hexval: charval: 2);
          testmsg = 'in EBCDIC, ' + %char(UCS_AT)
                  +        ' is ' + hexval;
          QUILNGTX( testmsg: %len(testmsg): ' ': ' ': 0);

          HTTP_setCCSIDs(1208: 0);

          form = WEBFORM_open();
          WEBFORM_setVar(form: 'lib'
                        : 'test' + %char(UCS_EACUTE) + 'test');
          WEBFORM_setVar(form: 'ccr': '75');
          WEBFORM_setVar(form: 'del': %char(0));
          WEBFORM_setVar(form: 'ede': 'destinataire'
                                    + %char(UCS_AT)
                                    + 'domain.com');
          WEBFORM_setVar(form: 'eem': 'emetteur'
                                    + %char(UCS_AT)
                                    + 'domain.com');
          w_text = 'test' + %char(UCS_EACUTE) +  'test';
          pText = %addr(w_text) + 2;
          WEBFORM_setPtr(Form: 'txt': pText: %len(w_text));
          WEBFORM_postData( Form : myPointer : dataSize );

          QUILNGTX( debug: dataSize: ' ': ' ': 0);

          *inlr = *on;
       /end-free
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------