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

Re: question about none english character when using HTTPAPI



Johan,

I would not bet that the data appear in the debug log as it is send over 
the wire, because by default HTTP API uses CCSID 819 for the log file.

It seems that changing the CCSID with HTTP_SetfileCCSID(1208) will 
translate the data to 1208 before adding it to the debug log:

    HTTP_SetfileCCSID(1208);
    HTTP_debug(*ON: 'yourDebugFile');

Do not forget to delete the existing debug file in order to start a new one.

Regards,

Thomas.

Johan Wigh schrieb:
>    Hi! Thomas!
>    I have now tried to write the files to the IFS both with your
>    testdriver! I have even written my own XML the same way!
>    When lI look at the file through The Iseries Navigator it looks OK and
>    the swedish character looks OK So the Conversion seems ok!
>    I have looked at the debug files generated from HTTPAPI there are he
>    swedish character not ok!  Maybe i have recompile the HTTP and set
>    another CCSID in the program?
>    /Johan
>    --- Den ons 2010-03-03 skrev thomas.raddatz@xxxxxx
>    <thomas.raddatz@xxxxxx>:
> 
>      Från: thomas.raddatz@xxxxxx <thomas.raddatz@xxxxxx>
>      Ämne: Re: question about none english character when using HTTPAPI
>      Till: ftpapi@xxxxxxxxxxxxxxxxxxxxxx
>      Datum: onsdag 3 mars 2010 10.28
> 
>    Johan,
>    I suggest to use the attached test program to convert the swedish 'Ö'
>    to
>    UTF-8 and verify the result. I used CRTRPGMOD and CRTPGM to create it:
>       crtrpgmod raddatz/test_iconv raddatz/qsrc37 dbgview(*list)
>       crtpgm raddatz/test_iconv actgrp(*new)
>    Make sure to change AtSign37 to the swedish 'Ö' and adjust the path
>    name
>    of the output file before compiling the program.
>    If everything is fine I assume that the problem is at the receiving
>    side.
>    By the way, did you properly specify <?xml version="1.0"
>    encoding="UTF-8"?> at the beginning of your request message?
>    Furthermore you may ask your network guy to trace the communication
>    data.
>    That often helps a lot to solve a problem.
>    Regards,
>    Thomas
>    [1]ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx schrieb am 02.03.2010
>    21:25:05:
>    > Von:
>    >
>    > [2]johan_wigh@xxxxxxxx
>    >
>    > An:
>    >
>    > [3]ftpapi@xxxxxxxxxxxxxxxxxxxxxx
>    >
>    > Datum:
>    >
>    > 02.03.2010 21:59
>    >
>    > Betreff:
>    >
>    > Re: question about none english character when using HTTPAPI
>    >
>    > Gesendet von:
>    >
>    > [4]ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
>    >
>    > If i try to answer
>    > To anser point 1-41.  I have tried different methods of approach
>    >  both the XML stored in database file and   written  straight into
>    > the program! No really difference at all! Same problem occur!
>    > 5. The CCSID of the machine and job is 65535!
>    > The strange thing is that when i consume webservice that in the
>    > response send back the swedish letter of Ö i can read  the variable
>    > ok. The problem is that when im sendning the same letter Ö to
>    > anotther webservice it comes out wrong as ?? on the other side!
>    > I have tried both with and without the function HTTP_setCCSIDs(1208
>    > :0). and using the XML enconding tag UTF-8 and ISO-8859-1
>    > /Johan
>    >
>    >
>    >
>    >
>    >
>    >
>    >
>    > --- Den tis 2010-03-02 skrev Thomas Raddatz
>    <[5]thomas.raddatz@xxxxxxxxxxx>:
>    >
>    > Från: Thomas Raddatz <[6]thomas.raddatz@xxxxxxxxxxx>
>    > Ämne: Re: question about none english character when using HTTPAPI
>    > Till: "HTTPAPI and FTPAPI Projects"
>    <[7]ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
>    > Datum: tisdag 2 mars 2010 20.33
>    >
>    > Johan,
>    >
>    > I do not know whether I will be able to solve your CCSID problem
>    entirely
>    > or not. I am also not sure that the following explanation explains
>    the ?
>    > character(s) at the receiving side. Nevertheless, please answer the
>    > following questions:
>    >
>    > 1) Are the non-english characters hard coded literals such as 'Hello
>    World'?
>    >
>    > 2) If the non-english characters are literals, what is the CCSID of
>    your
>    > source physical file?
>    >
>    > 3) Are the non-englich characters read from a file?
>    >
>    > 4) If the non-english characters are read from a file, what is the
>    CCSID
>    of
>    > the file.
>    >
>    > 5) What is the CCSID of your job?
>    >
>    >
>    > There are several potential reasons for the problem:
>    >
>    > a) If your job CCSID is 65535 (=*HEX) and the characters are read
>    from a
>    > file, no CCSID conversion (file to job) takes place. But HTTP API
>    converts
>    > the data from the job CCSID to 1208 with HTTP_setCCSIDs(1208 :0).
>    >
>    > b) If the CCSID of your source physical file does not match the
>    CCSID of
>    > your job (parameter CCSID or default CCSID for CCSID=65535) the
>    literals
>    in
>    > your program do not have the same CCSID of your job and hence HTTP
>    API
>    > cannot correctly translate the request message with
>    HTTP_setCCSIDs(1208
>    :0).
>    >
>    > Example:
>    > I wrote a module with CCSID 37 that uses iconv() to translate the
>    '@'
>    > character to CCSID 1208. It then writes the UTF-8 data to a file in
>    binary
>    > mode. When I run the job with CCSID 37 everything works like a
>    charm.
>    But
>    > when I change the job CCSID to 273 (German) the '@' sign is
>    converted to
>    '§'.
>    >
>    > Regards,
>    >
>    > Thomas
>    >
>    >
>    >
>    >
>    > Johan Wigh schrieb:
>    > >    Hi!
>    > >
>    > >    Im testing to use HTTPAPI for sending Soap messages to internal
>    > >    webservice att our business!
>    > >
>    > >    But when im consuming a webservice and sendning "non english"
>    > >    character i get "??" on the receiving side
>    > >
>    > >    I have tried to set the CCSID to UTF-8
>    > >    HTTP_setCCSIDs(1208 :0); i get ??
>    > >    HTTP_setCCSID(1252:0)    i get ?
>    > >
>    > >    The webservice im using is based in a windows enviroment and is
>    > >    supposed to use UTF-8
>    > >
>    > >
>    > >
>    > >    When Im consuming another webservices that and receiving none
>    english
>    > >    characters it works fine and it recieves the non english
>    characters
>    > >    ok! with and without HTTP_setCCSID!
>    > >
>    > >    I found some topics around but i still cant figure out what he
>    problem
>    > >    can be
>    > >    /Johan from Sweden
>    > >
>    > >
>    > >    __________________________________________________
>    > >    Använder du Yahoo!?
>    > >    Är du trött på spam? Yahoo! E-post har det bästa spamskyddet
>    som
>    finns
>    > >    [8]http://se.mail.yahoo.com
>    > >
>    > >
>    > >
>    > >
>    ----------------------------------------------------------------------
>    --
>    > >
>    > >
>    ----------------------------------------------------------------------
>    -
>    > > This is the FTPAPI mailing list.  To unsubscribe, please go to:
>    > > [9]http://www.scottklement.com/mailman/listinfo/ftpapi
>    > >
>    ----------------------------------------------------------------------
>    -
>    >
>    ----------------------------------------------------------------------
>    -
>    > This is the FTPAPI mailing list.  To unsubscribe, please go to:
>    > [10]http://www.scottklement.com/mailman/listinfo/ftpapi
>    >
>    ----------------------------------------------------------------------
>    -
>    >
>    >
>    > __________________________________________________
>    > Använder du Yahoo!?
>    > Är du trött på spam?  Yahoo! E-post har det bästa spamskyddet som
>    finns
>    > [11]http://se.mail.yahoo.com 
>    >
>    ----------------------------------------------------------------------
>    -
>    > This is the FTPAPI mailing list.  To unsubscribe, please go to:
>    > [12]http://www.scottklement.com/mailman/listinfo/ftpapi
>    >
>    ----------------------------------------------------------------------
>    -
>    --
>    IMPORTANT NOTICE:
>    This email is confidential, may be legally privileged, and is for the
>    intended recipient only. Access, disclosure, copying, distribution, or
>    reliance on any of it by anyone else is prohibited and may be a
>    criminal
>    offence. Please delete if obtained in error and email confirmation to
>    the sender.
> 
>      -----Infogad bilaga följer-----
> 
>    ----------------------------------------------------------------------
>    -
>    This is the FTPAPI mailing list.  To unsubscribe, please go to:
>    [13]http://www.scottklement.com/mailman/listinfo/ftpapi
>    ----------------------------------------------------------------------
>    -
> 
>    __________________________________________________
>    Använder du Yahoo!?
>    Är du trött på spam? Yahoo! E-post har det bästa spamskyddet som finns
>    http://se.mail.yahoo.com
> 
> References
> 
>    1. file://localhost/mc/compose?to=ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
>    2. file://localhost/mc/compose?to=johan_wigh@xxxxxxxx
>    3. file://localhost/mc/compose?to=ftpapi@xxxxxxxxxxxxxxxxxxxxxx
>    4. file://localhost/mc/compose?to=ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
>    5. file://localhost/mc/compose?to=thomas.raddatz@xxxxxxxxxxx
>    6. file://localhost/mc/compose?to=thomas.raddatz@xxxxxxxxxxx
>    7. file://localhost/mc/compose?to=ftpapi@xxxxxxxxxxxxxxxxxxxxxx
>    8. http://se.mail.yahoo.com/
>    9. http://www.scottklement.com/mailman/listinfo/ftpapi
>   10. http://www.scottklement.com/mailman/listinfo/ftpapi
>   11. http://se.mail.yahoo.com/
>   12. http://www.scottklement.com/mailman/listinfo/ftpapi
>   13. 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
-----------------------------------------------------------------------