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

תשובה: Re: utf-8 and length



Probably i did not describe the issue very well.The double byte is not in the EBCDIC code rather it is in the converted utf-8 string. That is the source string is SBCS but contains "non english characters".
So conversion in CCSID4 is performed ok, however the length of the utf8 string is longer then the ebcdic string.
when sending the string it gets truncated, for example:
Source EBCDIC is 100 bytes long, some of the characters will be converted to 2 bytes in utf8.Target utf8 string is 150 bytes.
Doing trace i can see that only 100 bytes are sent resulting of course invalid xml document.
----- הודעה מקורית -----מאת: Scott Klement <sk@xxxxxxxxxxxxxxxx>תאריך: יום ה', אוגוסט 31, 2006 6:55 pmנושא: Re: utf-8 and lengthאל: HTTPAPI and FTPAPI Projects <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
> > HTTPAPI does not currently support double-byte EBCDIC characters.  > It > assumes that every EBCDIC character is exactly one byte long.> > I've never worked in an environment where double-byte characters > are used. > I've never been trained in how to use them.  I don't have access > to a > double-byte character system to test the code, even if I had a > clue how to > write it. :)> > This leaves you with two choices:> > a) You can call HTTP_url_post_raw2(), which does absolutely no > translation, and do all of the translation and XML parsing yourself.> > b) You can change CCSIDR4 to support double-byte EBCDIC, and > change > everything that calls it, test it, and contribute it back to the > project.> -- > Scott Klement  http://www.scottklement.com> > > On Thu, 31 Aug 2006, Shahar Mor wrote:> > > Hi all,> >> > I am using HTTPAPI to call webservices from RPG , it works very > well and > > fast with several services. recently Encountered an issue with > UT8 and > > non english characters as followes:> >> > say my ebcdic string is abb*** (where * = character that is > double byte > > in utf-8) this is 6 bytes> >> > my utf-8 string will become 9 bytes (the * will become 2 > character for > > each *)> >> > however post_xml will calculate string as 6 bytes and not 9 > bytes thus > > truncating my message and creating invalid xml document.> >> > I think we need to update the code and let it calculate actual > length > > after conversion, but not sure.> >> >> > Can someone smarter then myself take alook at it ?> >> >> > -----------------------------------------------------------------> ------> > 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-----------------------------------------------------------------------