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

Re: Ftpapi and Thai Language support



Sender: Christian <chrisv5@xxxxxx>

Hello Jiguang,

how's Singapore? Hot and humid as always? Have they finally rebuilt Merlion Park or is it still a construction site? ;-)

The IFS CCSID attribute does not get used for a PUT by FTPAPI at all. You are right, 1252 would be wrong, if it contains Thai chararcters.

What you have to do are the following steps:

- ensure you send the file in ASCII mode, because the receiver uses Unix
  rc = ftp_binarymode(SessID: *OFF);

- set the appropriate code pages for your file and the receiver's file;
  rc = ftp_codepage(SessID: cpRemote: cpLocal);

  NOTE: you *must* do that, even if they are identical, otherwise some
        default translation from EBCDIC to US ASCII happens, which will
        not please you

where:
  SessID   ... placeholder for your FTP API session ID
  cpLocal  ... the "real" code page of your IFS file
  cpRemote ... the expected code page of the receiver


You might get away by sending the file as binary, if the following conditions are met:


- no code page conversion required
- the file contains no CRLF (seems like it is an EDIFACT file)

Another note: if you do any DIR or LIST *after* the ftp_codepage, you are out of luck, unless you applied my patch which I have posted about a week ago

Cheers,
Christian

jg_xue@xxxxxxxxxxxx wrote:
Sender: jg_xue@xxxxxxxxxxxx

Hi there,

My EDI application using FTPAPI has been working for some time with pure
English characters.

Recently, I need to send some IFS files including Thai Characters to our
customer who is using Unix system

My IFS file's attribute is:

Display Attributes

Object . . . . . . : /cmtedi/outbox/data/SM200605221411.TXT

Type . . . . . . . . . . . . . . . . . : STMF

Owner  . . . . . . . . . . . . . . . . :   QPGMR
System object is on  . . . . . . . . . :   Local
Auxiliary storage pool . . . . . . . . :   1
  Object overflowed  . . . . . . . . . :   No

Coded character set ID . . . . . . . . :   1252
Hidden file  . . . . . . . . . . . . . :   No
PC system file . . . . . . . . . . . . :   No
Read only  . . . . . . . . . . . . . . :   No

Need to archive (PC) . . . . . . . . . :   Yes
Need to archive (OS/400) . . . . . . . :   Yes


The file shows in i5/OS environment without any problem, however when sending it to Unix, the Thai character could not be translated correctly.

I tried to change the IFS's attribute to CCSID 838, and  when doing FTP,
and manage to use LTYPE C 874, it does not work as well.

Anybody can help?

Regards,
Xue Jiguang

-----------------------------------------------------------------------
Important : This message is intended for the recipient(s) addressed
above. It contains privileged and confidential information.  If you
are not the intended recipient, kindly notify the sender immediately
 by replying to this message and then delete it from your system.
You must not read,  copy,  use,  disseminate,  disclose,  retain or
reproduce all or any part of the information or any attachments
from this communication in any form. Thank you.

Disclaimer  : Email communications are not secure.  While we have
taken every  reasonable effort  to ensure that this  communication
has not been tampered with,  Canon is not responsible for any changes
made to the contents of or any attachments to this message without its
consent.  If you wish to receive a hard copy of this  message to verify
the accuracy of the contents thereof, please contact the sender. Note
that only views,  opinions or such other  information contained in this
message that relate to the official business of Canon is to be taken to
have been sent by  and on behalf of Canon.  All opinions,  conclusions
and other  information  expressed in  this message  not of an official
nature  shall  not be  deemed  as  given  or  endorsed  by  Canon unless
otherwise indicated by an authorized  representative  independent of
this message.



-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubsribe from the list send mail
to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
-----------------------------------------------------------------------


-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubsribe from the list send mail
to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
-----------------------------------------------------------------------