RPG strings can only support 65535 chars, so the idea of converting a Java 
string longer than 65535 to RPG doesn't completely make sense.  How can 
you convert it to an RPG string, if RPG doesn't support strings that 
large?
Now, if you want to store it into memory allocated to a pointer, or a user 
space, or some other construct that doesn't have the 65535 limitation, you 
could -- by calling the JNI functions GetStringLength() and 
GetStringChars().  This'll give you Unicode data, and you'll need to 
convert it to EBCDIC -- RPG's UCS2 support should be able to do the 
conversion.
Or, you could call GetStringUTFChars() and you'll get memory that's 
dynamically allocated containing a C-style null-terminated string in 
UTF-8, already dynamically allocated to a pointer. You could use the 
%STR() BIF in RPG to convert it to an RPG-style string (albeit, still in 
UTF-8) and ReleaseStringUTFChars() will return the dynamic memory to the 
system.  But, you'll have to use iconv() or a similar function to convert 
it to EBCDIC.
So, it's not easy, but possible...

---
Scott Klement  http://www.scottklement.com

On Fri, 26 May 2006, Adele Cavalli wrote:

Bonjour,

because it seems that getBytes can only be used with
strings up to 65535, is there another way to convert a
java String longer than 65535 into an RPG string ?

Thanks.
Adele.







___________________________________________________________________________
Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son interface 
révolutionnaire.
http://fr.mail.yahoo.com
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact copyright@midrange.com.

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.