×
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.
On 31/03/2008, at 1:26 AM, Aschenbrenner, Poul wrote:
Can som one tell haw to convert string from ASCII CCSID 61952 to
EBCDIC
037.
CCSID 61952 is Unicode V.1 (multi-byte) therefore not all characters
can be converted into CCSID 37 (single-byte).
I have try %Char and define varibales as CCSID with no luck.
The archives would show that the iconv APIs are the correct method
for dealing with this.
On a suitably recent release of RPG you should be able to define the
fields as type C and specify the CCSID on the D-spec definition. Then
you can use %CHAR to convert. However, I'd still use the iconv APIs
simply because they work in most languages.
And I have also try iconv() but I can not find any describtion for
this.
They are described in the Information Centre:
Programming->APIs->APIs by Category->National Language Support->Data
Conversion APIs
I am using QIBM_QPWFS_FILE_SERV Format PWFS0100 and this return
File name in the following format.
If you search the IBM site for the format name you will find an
example program that shows how to convert the file name. The example
is in C but it's trivial to convert to RPG IV--especially since this
has been discussed previously and the archives contain much
information. Note that the example uses the QTQCVRT CDRA API to
convert rather than using iconv directly.
The name of the file. The length of this field is specified by the
File Name Length (the previous field). The file name is returned in
the ISO/IEC 10646 (UCS--2 Level 1) character set, CCSID 61952.
The VRM540 documentation says the file name is returned in CCSID
1200. Interestingly, this has not been marked with a change flag even
though the VRM530 documentation still says CCSID 61952. The
difference is that 61952 is UCS2-level 1 while 1200 (and 1208 and
13488) is based on UCS2-level 2.
Furthermore, at least as far back as VRM510 the documentation states
in a note at the bottom how to convert the file name.
I can see that CCSID 61952 must be in dual byte and I want to
convert it to text variable.
You will only be able to convert characters from 61952 that have an
equivalent single-byte character in CCSID 37.
Regards,
Simon Coulter.
--------------------------------------------------------------------
FlyByNight Software OS/400, i5/OS Technical Specialists
http://www.flybynight.com.au/
Phone: +61 2 6657 8251 Mobile: +61 0411 091 400 /"\
Fax: +61 2 6657 8251 \ /
X
ASCII Ribbon campaign against HTML E-Mail / \
--------------------------------------------------------------------
As an Amazon Associate we earn from qualifying purchases.