× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hey John, that is true and I should have also commented that, I have done
so in the past, I also use the CCSID keyword when declaring my stand-alone
variables in my programs and the simple assignment to another one declared
with another CCSID is perfectly good. That is when you already know and
manage the destination CCSID, but in general, when you don't know, you can
simply set a parameter and use iconv().

Example:

dcl-s mySpanishEBCDICCharacters char(100) csid(037) inz('áéíóúñü);
dcl-s mySpanishUTF8Characters char(150) ccsid(1208) inz; // it can also be
used ccsid(*utf8)

mySpanishUTF8Characters = mySpanishEBCDICCharacters; // Implicit,
compile-time call to a conversion routine, I believe it also calls iconv(),
not sure.

This is a very simple example when you know you want to deal with internet
data exchange, where utf-8 is the most commonly used.
And keep in mind that these special characters are two-, three and even
four- bytes long depending on the utf version you're using, namely, UTF-8,
UT-16 or UTF-32.

HTH
JS

El jue, 17 oct 2024 a las 8:54, John Yeung (<gallium.arsenide@xxxxxxxxx>)
escribió:

On Thu, Oct 17, 2024 at 9:48 AM Charles Wilt <charles.wilt@xxxxxxxxx>
wrote:

You should be using ICONV() or RPG IV's build in conversion...not
QDCXLATE!

https://www.linkedin.com/pulse/ebcdic-ascii-rpg-iv-bob-cozzi-jds4c/

Excellent reference! It seems as though it was written *precisely* to
address OP!

However, I would strongly suggest going straight to the "punch line"
if you will, especially since readers often won't read linked-to
articles in their entirety, if at all.

The advice should be this: Use RPG's built-in conversion capabilities.
Period.

Presumably, there are some situations where iconv *might* be
preferable, but using RPG's built-in facilities is so much simpler and
easier that it is kind of ridiculous *not* to try those first.

John Y.
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.



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-2024 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 [javascript protected email address].

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