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



Chinese characters cannot be converted to CCSID 37, because CCSID 37 
contains only single-byte US English characters.

    Alexei
always speaking for myself




"Mohammad Tanveer" <mtanveer@xxxxxxxxxxxxxxxxx> 
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
02/23/2006 02:06 PM
Please respond to
RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>


To
"'RPG programming on the AS400 / iSeries'" <rpg400-l@xxxxxxxxxxxx>
cc

Subject
RE: UCS2 TO code page 037






Hi Scott,

This logic is not working for Chinese characters stored in 13488.  Is 
there
something I need to do differently?

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

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.