× 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.



I am trying to save Russian characters from a CCSID field into a Code Page
37 field and then from code page 37 field into another CCSID field.

 

I am able to do it using this example but for some reason in my code page 37
field I still see some special character?  Why?

 

 

Thanks 

 

 

 

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Scott Klement
Sent: Wednesday, February 22, 2006 4:05 PM
To: RPG programming on the AS400 / iSeries
Subject: Re: UCS2 TO code page 037

 

 

> How can I convert UCS2 to code page 037 and then from code page 037 to
UCS2?

> Any examples?

 

UCS2 is CCSID 13488 (more or less) on the iSeries.  So you can do this:

 

      D input1          s             50A

      D output1         s             50C   CCSID(13488)

 

      D input2          s             50C   CCSID(13488)

      D output2         s             50A

       /free

 

         // from the job CCSID to UCS2

 

         Input1 = 'Nows the time for all good men';

         Output1 = %ucs2(Input1);

 

         // from UCS2 to the Job CCSID

 

         input2 = %ucs2('I love my dog spot');

         output2 = %char(input2);

 

         *inlr = *on;

 

       /end-free

 

Change it to CCSID(1200) if you want UTF-16 (which is a superset of 13488, 

I think.)


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.